ISPConfig 3

Welcome to the bugtracker of the ISPConfig project. This bugtracker is for ISPConfig 3.x only.
Tasklist

FS#621 - Error in log rotation

Attached to Project: ISPConfig 3
Opened by Alexander Stehlik (astehlik) - Thursday, 12 March 2009, 18:48 GMT
Last edited by Till (Till) - Thursday, 12 March 2009, 21:15 GMT
Task Type Bug Report
Category Backend / Core
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version 3.0.0.9 RC2
Due in Version 3.0.1 Final
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

In the /usr/local/ispconfig/server/cron_daily.php is are 2 errors in the log rotation (as far as I understand).

First, the command to compress the log file creates a new compressed file, but doesn't delete the uncompressed one. As far as I can see it doesn't get deleted at all.
So my first recommendation would be, to change line 117 from

exec("gzip -c $logfile > $logfile.gz");

to

exec("gzip $logfile.gz");

so that the uncompressed file disappears.

Second, the compessed file will be deleted immediatly after it was created since there is a bug in line 122 that will delete the yesterdays log file instead of the one that is one month old. So you need to change

$logfile = escapeshellcmd($rec["document_root"].'/log/'.$yesterday.'-access.log.gz');

to

$logfile = escapeshellcmd($rec["document_root"].'/log/'.$month_ago.'-access.log.gz');

Kind regards,

Alex.
This task depends upon

Closed by  Till (Till)
Thursday, 12 March 2009, 21:15 GMT
Reason for closing:  Fixed

Loading...