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

Follow

Comments

4 comments

  • Avatar
    Bob B

    Hello,

    This solution is what I'm looking for to rotate several customers with quickly growing logs, where daily is not enough.  However, I'm concerned this new scheduled task might conflict with the normal daily task.  If I add this new task, as in the example, above, I'm concerned that when the normal daily task runs, this new task might also run at the same time, or might still be running, when the daily task runs.  

    Would it be helpful to schedule this new task to run on a schedule less likely to happen at the same time the normal daily task runs?

    0
    Comment actions Permalink
  • Avatar
    Anna Morozyuk

    Hello @Bob B,

    You concern is totally understandable and valid, that is why note added on the top of the article about the possible server performance influence. Let me clarify:

    These tasks will not interrupt each other, but will run simultaneously spawning many processes and thus overloading the server. It may happen only if amount of the domains is quite big and/or there are many files inside these domains' virtual directories on the server. Thus, before applying this resolution, you may estimate it either by just taking approximate time period judging by the domains' amount and disk space, or, as a possible way, you may want to run this command in the terminal:

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

    Check how much time will it take to execute and set appropriate time period for the task.
    You may also want to run this command in the screen if amount of domains is quite big and additionally you may enable Plesk debug mode, so this command will give you prompt output as well.

     

    1
    Comment actions Permalink
  • Avatar
    Bob B

    @Anna Morozyuk,

    Thank you.  Great information.  Quick followup question...  If there are only a few end users whose logs grow big quickly, and need more frequent rotation, would it be a better idea to use the "/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com" command, via hourly Scheduled Task (cron), for the affected domains, instead of "ExecuteStatistics" for all domains, as described in article (https://support.plesk.com/hc/en-us/articles/213936305-How-to-recalculate-statistics-for-a-particular-domain-in-Plesk-)?

    Best Regards,
    Bob

    0
    Comment actions Permalink
  • Avatar
    Denis Bykov

    @Bob B

    Indeed, that will be correct as well.
    Thank you for the suggestion. I added it to the article.

    1
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request