Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ISPConfig 3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 556
    • Issues 556
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #505
Closed
Open
Created Mar 12, 2009 by Alexander Stehlik@astehlik

Error in log rotation

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.

Assignee
Assign to
Time tracking