From b28db4111a699f1e736b4a96ff8a4cfb9b2cc096 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Thu, 12 Mar 2009 21:14:48 +0000 Subject: [PATCH] Fixed bug in logrotation. --- server/cron_daily.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/cron_daily.php b/server/cron_daily.php index 88caab96b..37f4f4d1c 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -115,11 +115,12 @@ foreach($records as $rec) { if(@is_file($logfile)) { // Compress yesterdays logfile exec("gzip -c $logfile > $logfile.gz"); + unlink($logfile); } // delete logfiles after 30 days $month_ago = date("Ymd",time() - 86400 * 30); - $logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log.gz'); + $logfile = escapeshellcmd($rec["document_root"].'/log/'.$month_ago.'-access.log.gz'); if(@is_file($logfile)) { unlink($logfile); } -- GitLab