Scheduling Tasks with Windows Task Scheduler (Windows Hosting)
If you need to run scripts on your server at specific time, use the task scheduler facility on your server to make the system automatically run the scripts for you.
During installation of Parallels Plesk Panel the following tasks are automatically created:
- Update Dr.Web Antivirus database – updates Dr.Web virus database
- Statistics calculation - generates statistics on resource usage, such as traffic and disk space.
As all these tasks are related to domain statistics, databases and reports, it is strongly recommended that you neither change nor remove these tasks.
Note. You can also schedule tasks on a per-domain basis. To do so, follow the same procedures listed below, but instead of going to Settings > Scheduled Tasks, go to Domains > domain name > Scheduled Tasks.
To schedule a task:
- Go to Settings > Scheduled Tasks (in the General group).
- Click Schedule New Task.
- Leave the Switched on check box 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 Scheduler notification, specify whether the scheduler should notify you when it runs this task. The following options are available:
- Specify which command to run. Type it into the Path to 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\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
- 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 check boxes 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 temporarily suspend execution of a scheduled task:
- Go to Settings > Scheduled Tasks (in the General group).
- Choose a task that you wish to suspend and click on the command name.
- Clear the Switched on check box.
To resume execution of scheduled task:
- Go to Settings > Scheduled Tasks (in the General group).
- Choose a task whose execution you wish to resume and click on the command name.
- Select the Switched on check box.
To cancel a task:
- Go to Settings > Scheduled Tasks (in the General group).
- Select a check box to the left of the task that you want to cancel.
- Click Remove.
- Confirm removal and click OK.