Plesk

How to force Plesk to rotate logs more often on Linux?

Question

How to force Plesk to rotate logs more often?

Answer

By default Plesk rotates logs once per day (during the Daily task).

To make log rotation more often, log rotation task can be scheduled in addition to the Daily one:

Note: This modification might result in performance degradation if the server has a lot of domains: statistics are analyzed alongside with the log rotation.

  1. Log into Plesk.

  2. Navigate to Tools & Settings > Scheduled Tasks.

  3. Click on Add Task.

  4. Add the following text to the Command field:

    To rotate logs for all domains:

    /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php -f ExecuteStatistics

    To rotate logs for a single domain:

    /usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com

  5. Set to run task Hourly and click on Ok.