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 {
$error_logfile = escapeshellcmd($rec['document_root'].'/' . $log_folder . '/error.log');
// rename older files (move up by one)
$num = $log_retention;
while($num >= 1 && is_file($error_logfile . '.' . $num . '.gz')) {
rename($error_logfile . '.' . $num . '.gz', $error_logfile . '.' . ($num + 1) . '.gz');
while($num >= 1) {
if(is_file($error_logfile . '.' . $num . '.gz')) rename($error_logfile . '.' . $num . '.gz', $error_logfile . '.' . ($num + 1) . '.gz');
$num--;
}
// 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