Commit cafdec2a authored by tbrehm's avatar tbrehm

Fixed: FS#1287 - ispconfig.log rotated twice

parent db377c64
...@@ -1470,6 +1470,7 @@ class installer_base { ...@@ -1470,6 +1470,7 @@ class installer_base {
//* Add Log-Rotation //* Add Log-Rotation
if (is_dir('/etc/logrotate.d')) { if (is_dir('/etc/logrotate.d')) {
@unlink('/etc/logrotate.d/logispc3'); // ignore, if the file is not there @unlink('/etc/logrotate.d/logispc3'); // ignore, if the file is not there
/* We rotate these logs in cron_daily.php
$fh = fopen('/etc/logrotate.d/logispc3', 'w'); $fh = fopen('/etc/logrotate.d/logispc3', 'w');
fwrite($fh, fwrite($fh,
"/var/log/ispconfig/ispconfig.log { \n" . "/var/log/ispconfig/ispconfig.log { \n" .
...@@ -1487,6 +1488,7 @@ class installer_base { ...@@ -1487,6 +1488,7 @@ class installer_base {
" delaycompress \n" . " delaycompress \n" .
"}"); "}");
fclose($fh); fclose($fh);
*/
} }
} }
......
...@@ -234,6 +234,13 @@ if(is_file($logfile) && filesize($logfile) > 10000000) { ...@@ -234,6 +234,13 @@ if(is_file($logfile) && filesize($logfile) > 10000000) {
exec("cat /dev/null > $logfile"); exec("cat /dev/null > $logfile");
} }
// rotate the cron.log when it exceeds a size of 10 MB
$logfile = '/var/log/ispconfig/cron.log';
if(is_file($logfile) && filesize($logfile) > 10000000) {
exec("gzip -c $logfile > $logfile.1.gz");
exec("cat /dev/null > $logfile");
}
####################################################################################################### #######################################################################################################
// Cleanup website tmp directories // Cleanup website tmp directories
####################################################################################################### #######################################################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment