From b28db4111a699f1e736b4a96ff8a4cfb9b2cc096 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Thu, 12 Mar 2009 17:14:48 -0400 Subject: [PATCH] Fixed bug in logrotation. --- server/cron_daily.php | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/server/cron_daily.php b/server/cron_daily.php index 88caab9..37f4f4d 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -115,11 +115,12 @@ 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); } -- Gitblit v1.9.1