Skip to content
Snippets Groups Projects
Commit 5ef60a7f authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#1456 - Web domain's log rotate problem

parent f2169ac8
No related branches found
No related tags found
2 merge requests!46Master,!21Master
......@@ -280,6 +280,15 @@ foreach($records as $rec) {
if(@is_file($logfile)) {
unlink($logfile);
}
//* Delete older Log files, in case that we missed them before due to serverdowntimes.
$datepart = date('Ym',time() - 86400 * 31 * 2);
$logfile = escapeshellcmd($rec['document_root']).'/log/'.$datepart.'*-access.log.gz';
exec('rm -f '.$logfile);
$logfile = escapeshellcmd($rec['document_root']).'/log/'.$datepart.'*-access.log';
exec('rm -f '.$logfile);
}
#######################################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment