diff --git a/server/cron_daily.php b/server/cron_daily.php index 571a02bdf36897ace9de6c944bf1bc88a44fd31b..d8a7b647c22898deb2177fa0179c0aa38661a459 100644 --- a/server/cron_daily.php +++ b/server/cron_daily.php @@ -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); } #######################################################################################################