Skip to content

Commit 7c05ac3

Browse files
author
Till Brehm
committed
Fixed: #5062 log rotate ispconfig error.log.1.gz
1 parent c9abb2d commit 7c05ac3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/lib/classes/cron.d/200-logfiles.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ public function onRunJob() {
150150
$error_logfile = escapeshellcmd($rec['document_root'].'/' . $log_folder . '/error.log');
151151
// rename older files (move up by one)
152152
$num = $log_retention;
153-
while($num >= 1 && is_file($error_logfile . '.' . $num . '.gz')) {
154-
rename($error_logfile . '.' . $num . '.gz', $error_logfile . '.' . ($num + 1) . '.gz');
153+
while($num >= 1) {
154+
if(is_file($error_logfile . '.' . $num . '.gz')) rename($error_logfile . '.' . $num . '.gz', $error_logfile . '.' . ($num + 1) . '.gz');
155155
$num--;
156156
}
157157
// compress current logfile

0 commit comments

Comments
 (0)