Commit 7c05ac39 authored by Till Brehm's avatar Till Brehm

Fixed: #5062 log rotate ispconfig error.log.1.gz

parent c9abb2d5
...@@ -150,8 +150,8 @@ class cronjob_logfiles extends cronjob { ...@@ -150,8 +150,8 @@ class cronjob_logfiles extends cronjob {
$error_logfile = escapeshellcmd($rec['document_root'].'/' . $log_folder . '/error.log'); $error_logfile = escapeshellcmd($rec['document_root'].'/' . $log_folder . '/error.log');
// rename older files (move up by one) // rename older files (move up by one)
$num = $log_retention; $num = $log_retention;
while($num >= 1 && is_file($error_logfile . '.' . $num . '.gz')) { while($num >= 1) {
rename($error_logfile . '.' . $num . '.gz', $error_logfile . '.' . ($num + 1) . '.gz'); if(is_file($error_logfile . '.' . $num . '.gz')) rename($error_logfile . '.' . $num . '.gz', $error_logfile . '.' . ($num + 1) . '.gz');
$num--; $num--;
} }
// compress current logfile // compress current logfile
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment