How to enable logging of daily maintenance task

Created:

2016-11-16 13:07:12 UTC

Modified:

2017-04-24 11:34:18 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to enable logging of daily maintenance task

Applicable to:

  • Plesk

Question

How to enable debug logging for Plesk Daily Maintenance Task?

Answer

For Linux:

  1. Create a backup of the /etc/cron.daily/50plesk-daily file:

    # cp -p /etc/cron.daily/50plesk-daily{,.orig}
  2. Unset executable bit:

    # chmod -x /etc/cron.daily/50plesk-daily.orig
  3. Replace the content of /etc/cron.daily/50plesk-daily file with the following content:

    #!/bin/sh
    exec 1>>/root/50plesk-daily.log
    exec 2>&1
    set -x
    export PLESK_DEBUG_LEVEL=4

    # execute statistics collection
    /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

    # make a dump of mysql database
    /usr/local/psa/bin/mysqldump.sh >/dev/null 2>&1

    Debug log will be written to /root/50plesk-daily.log file.

  4. When monitoring is done, replace the /etc/cron.daily/50plesk-daily file with the original one and restore executable bit:
    # mv /etc/cron.daily/50plesk-daily{.orig,}
    # chmod +x /etc/cron.daily/50plesk-daily

For Windows:

  1. Check that there is no hanging Daily Maintenance Task processes.
  2. Turn off the Daily Maintenance Task in the Task Scheduler to avoid interference from its side.
  3. Run the following commands on the server using CLI:

    set PLESK_DEBUG_LEVEL=4

    "%plesk_dir%\\admin\\bin\\php.exe" -dauto_prepend_file="" -ddisplay_errors=on "%plesk_dir%\\admin\\plib\\DailyMaintainance\\script.php" >> c:\\debug_maintenance.log

    Debug log will be created in c:\\daily_maintenance_task_debug.log

  4. When monitoring is done, enable the Daily Maintenance Task in the Task Scheduler back.

Additional information

#213943445 - [HUB] Troubleshooting Statistics Issues in Plesk for Linux

Have more questions? Submit a request
Please sign in to leave a comment.