From cafdec2a465ab57626a32efb065c6d054f71d8eb Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Thu, 16 Sep 2010 09:20:00 -0400 Subject: [PATCH] Fixed: FS#1287 - ispconfig.log rotated twice --- server/cron_daily.php | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/server/cron_daily.php b/server/cron_daily.php index 83ef10c..f311e75 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -234,6 +234,13 @@ 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 ####################################################################################################### -- Gitblit v1.9.1