Scheduling Tasks (Linux)

Scheduling Tasks (Linux)

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

During installation of the Panel, 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. If you are subscribed to several hosting packages and have access to several webspaces associated with your account, in the Subscription menu at the top of the screen, select the required webspace.
  2. Go to the Websites & Domains tab > Scheduled Tasks (in the Advanced Operations group).
  3. Click Schedule New Task.
  4. Leave the Switched on checkbox selected.
  5. 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.

  6. 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 e-mail, you need to specify the following command in the Command input box:

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

  7. Click OK.

To receive notifications when the tacts are started:

  1. Go to the Websites & Domains tab > Scheduled Tasks (in the Advanced Operations group).
  2. Click Settings and specify the notification policy.

To temporarily suspend execution of a scheduled task:

  1. If you are subscribed to several hosting packages and have access to several webspaces associated with your account, in the Subscription menu at the top of the screen, select the required webspace.
  2. Go to the Websites & Domains tab > Scheduled Tasks (in the Advanced Operations group).
  3. Locate the task that you want to suspend and click the corresponding link in the Command column.
  4. Clear the Switched on checkbox and click OK.

To resume execution of a scheduled task:

  1. If you are subscribed to several hosting packages and have access to several webspaces associated with your account, in the Subscription menu at the top of the screen, select the required webspace.
  2. Go to the Websites & Domains tab > Scheduled Tasks (in the Advanced Operations group).
  3. Locate the task whose execution you want to resume and click the corresponding link in the Command column.
  4. Select the Switched on checkbox and click OK.

To cancel a task:

  1. If you are subscribed to several hosting packages and have access to several webspaces associated with your account, in the Subscription menu at the top of the screen, select the required webspace.
  2. Go to the Websites & Domains tab > Scheduled Tasks (in the Advanced Operations group).
  3. Select a checkbox to the left of the task that you want to cancel and click Remove.
  4. Confirm removal and click OK.

 
  • 890 Users Found This Useful
Was this answer helpful?