Articles in this section

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

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux

Question

How to force Plesk to rotate logs more often?

Answer

By default Plesk rotates logs once per day (during the ExecuteStatistics task of the Daily Maintenance script).

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

Warning: Do keep in mind that this modification may result in increased server resource consumption, especially if the server has a lot of domains. Statistics are also analyzed alongside with the log rotation actions.

  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:

    If you want to rotate logs for all domains on the server:

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

    If you want to rotate logs for a single domain:

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

  5. Set to run the scheduled task Hourly (or even more often) and press OK

     

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.