Skip to content

Commit b28db41

Browse files
committed
Fixed bug in logrotation.
1 parent 67cae4a commit b28db41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/cron_daily.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@
115115
if(@is_file($logfile)) {
116116
// Compress yesterdays logfile
117117
exec("gzip -c $logfile > $logfile.gz");
118+
unlink($logfile);
118119
}
119120

120121
// delete logfiles after 30 days
121122
$month_ago = date("Ymd",time() - 86400 * 30);
122-
$logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log.gz');
123+
$logfile = escapeshellcmd($rec["document_root"].'/log/'.$month_ago.'-access.log.gz');
123124
if(@is_file($logfile)) {
124125
unlink($logfile);
125126
}

0 commit comments

Comments
 (0)