Scheduling Tasks (Linux)

If you need to run scripts on your hosting account at specific time, use the task scheduler in Plesk to make the system automatically run the scripts for you.

During installation of Plesk, the following tasks are automatically created:

  • autoreport.php – delivers daily, weekly and monthly reports on domains (three separate tasks)
  • backupmng – initiates scheduled backing up of domains once every 30 minutes
  • statistics – generates statistics on resource usage by domains
  • mysqldump.sh - creates a backup copy of three MySQL databases: psadump, MySQL, and Horde databases

As all these tasks are related to statistics, databases, and reports, it is strongly recommended that you neither change nor remove them.

To schedule a task:

  1. Go to Websites & Domains > Scheduled Tasks.
  2. Click Add Task.
  3. Leave the Switched on checkbox selected.
  4. Specify when to run your command:
    • Minute - enter the value from 0 to 59
    • Hour - enter the value from 0 to 23
    • Day of the month - enter the value from 1 to 31
    • Month - enter the value from 1 to 12, or select the month from a drop-down box
    • Day of the week - enter the value from 0 to 6 (0 for Sunday), or select the day of the week from a menu.

    You can schedule the time using the UNIX crontab entry format. In this format, you can:

    • Enter several values separated by commas. Two numbers separated by a hyphen mean an inclusive range. For example, to run a task on the 4th, 5th, 6th, and 20th of a month, type 4-6,20.
    • Insert an asterisk to specify all values allowed for this field. For example, to run a task daily, type * in the Day of the month text box.

    To schedule the task to run every Nth period, enter the combination */N, where N is a value for this field (minute, hour, day, month). For example, */15 in the Minute field schedules the task to start every 15 minutes.

    You can type the contracted names of months and days of the week, which are the first three letters: Aug, Jul, Mon, Sat, and so on. However, the contracted names cannot be separated with commas or used together with numbers.

  5. Specify which command to run. Type it into the Command input box.

    For example, if you want to run the backup creation task at the specified time and have the backup file sent to your email, you need to specify the following command in the Command input box:

    /usr/local/psa/admin/sbin/backupmng

  6. Click OK.

To receive notifications when tasks are started:

  1. Go to Websites & Domains > Scheduled Tasks.
  2. Click Settings and specify the notification policy.

To temporarily suspend execution of a scheduled task:

  1. Go to Websites & Domains > Scheduled Tasks.
  2. Locate the task that you want to suspend and click the corresponding link in the Command column.
  3. Clear the Switched on checkbox and click OK.

To resume execution of a scheduled task:

  1. Go to Websites & Domains > Scheduled Tasks.
  2. Locate the task whose execution you want to resume and click the corresponding link in the Command column.
  3. Select the Switched on checkbox and click OK.

To cancel a task:

  1. Go to Websites & Domains > Scheduled Tasks.
  2. Select a checkbox to the left of the task that you want to cancel and click Remove.
  3. Confirm removal and click OK.
 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.