diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 3d3b60eb0612843e1dc978cac5ff778e8cd05710..609556d864af59fc2a4d9d5ab283634a4e7f4414 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1470,6 +1470,7 @@ class installer_base { //* Add Log-Rotation if (is_dir('/etc/logrotate.d')) { @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'); fwrite($fh, "/var/log/ispconfig/ispconfig.log { \n" . @@ -1487,6 +1488,7 @@ class installer_base { " delaycompress \n" . "}"); fclose($fh); + */ } } diff --git a/server/cron_daily.php b/server/cron_daily.php index 83ef10c5623afb888115abe9a62b51cef9e5432c..f311e75b84bbe353c609071e1c302bed2a0ca7ac 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -234,6 +234,13 @@ if(is_file($logfile) && filesize($logfile) > 10000000) { 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 #######################################################################################################