Skip to content

Commit 5ef60a7

Browse files
committed
Fixed: FS#1456 - Web domain's log rotate problem
1 parent f2169ac commit 5ef60a7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

server/cron_daily.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,15 @@ function setConfigVar( $filename, $varName, $varValue ) {
280280
if(@is_file($logfile)) {
281281
unlink($logfile);
282282
}
283+
284+
//* Delete older Log files, in case that we missed them before due to serverdowntimes.
285+
$datepart = date('Ym',time() - 86400 * 31 * 2);
286+
287+
$logfile = escapeshellcmd($rec['document_root']).'/log/'.$datepart.'*-access.log.gz';
288+
exec('rm -f '.$logfile);
289+
290+
$logfile = escapeshellcmd($rec['document_root']).'/log/'.$datepart.'*-access.log';
291+
exec('rm -f '.$logfile);
283292
}
284293

285294
#######################################################################################################

0 commit comments

Comments
 (0)