Schedule Task is a Operating System component that provides the ability to schedule the launch of programs or scripts at pre-defined times or after specified time intervals.
Login to the Plesk Control panel. go for the Website and Domains tab then select Show Advanced Operations.
Then select Schedule Task.
Now Select the System User under whom the scheduled task should be run.
Now click on the Schedule New Task.
In Linux the system application "Crontab" manage the Schedule Tasks. If you want to schedule a PHP script run at 1.00 am every day, then you need to set the required value as below.
Minute : 00
Hour : 01
Day of the Month : *
Month : *
Day of the Week: *
Command : php -f /var/www/vhosts/yourdomain.com/httpdocs/folder/filename.php
- Need to calculate the time is 24 hours format, i.e. 0-24 hours. Example: 1 pm = 13:00.
- A field may be an asterisk (*), which always stands for "first-last".
- Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive. For example, 8-11 for an "hours" entry specifies execution at hours 8, 9, 10 and 11.
- Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: "1,2,5,9", "0-4,8-12".
- Names can also be used for the "month" and "day of week" fields. Use the first three letters of the particular day or month Examples: jan, feb, dec or mon, sat, tue, etc. Ranges or lists of names are not allowed.
- Need to use the absolute path of the file, the default path is "/var/www/vhosts/yourdomain.com/httpdocs/". The syntex -f in php command specify the file you can use -q which run in quite mode.
Click OK to add the job.