Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Helmo
ISPConfig 3
Commits
7c05ac39
Commit
7c05ac39
authored
Jun 19, 2018
by
Till Brehm
Browse files
Fixed: #5062 log rotate ispconfig error.log.1.gz
parent
c9abb2d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/lib/classes/cron.d/200-logfiles.inc.php
View file @
7c05ac39
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment