If you need to run scripts on your hosting account at a specific time, use the task scheduler in Plesk to make the system automatically run the scripts for you.
To schedule a task:
- Go to Websites & Domains > Scheduled Tasks.
- Click Add Task.
- Leave the Active checkbox selected if you want your scheduled task to be active immediately after the creation.
- Type a name for your task in the Description field.
- In Notify, specify whether the scheduler should notify you when it runs this task. The following options are available:
- Do not notify - do not notify you.
- Send to the default email - send the notification to your default email address.
- Send to the email I specify - send the notification to the email specified in the corresponding field. After selecting this option, you need to type the required email address in the field on the right.
- Specify which command or executable file to run. Type it into the Path to the executable file input box. If you need to run the command with certain options, type them in the Arguments field.
- For example, if you want to run the statistics calculation task to count disc space and see more detailed information for the example.com and example.net domains, you need to specify the following path in the Path to executable file input box:
C:\Program Files (x86)\Parallels\Plesk\admin\bin\statistics.exe
and the following options in the Arguments field:
--disk-usage --process-domains=example.com, example.net –verbose
- If you want to run your own PHP script using the task scheduler, you need to specify the following path in the Path to executable file input box:
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.exe
and specify the script location in the Arguments field:
C:\Inetpub\vhosts\mydomain.tld\httpdocs\myscript.php
- For example, if you want to run the statistics calculation task to count disc space and see more detailed information for the example.com and example.net domains, you need to specify the following path in the Path to executable file input box:
- Select the appropriate priority in the Task priority field. Task priority can be set to Low, Normal or High.
- Specify when to run your command by selecting the appropriate checkboxes in the Hours, Days of month, Months or Days of week fields.
- Click OK to schedule the task or click Run Now to schedule the task and immediately run it.
To cancel a task:
- Go to Websites & Domains > Scheduled Tasks.
- Select a checkbox to the left of the task that you want to cancel and click Remove.
- Confirm the removal and click OK.