If you want a task to be run at a scheduled interval, then you will need to set a cronjob in your cPanel account.
1) Log into your cPanel account. How to login to cPanel
2) Locate the Advanced section and select Cron Jobs
3) Scroll down and you should see the following section. In the Common Settings there would be a few presets you can use. Which should be sufficient in most cases. If you need to setup a cronjob at a specific time, here is a simple guide.
Minute: To run at every minute */x, substitute the x for the minute interval. For example; every 15 minutes cronjob would be
*/15 * * * *
To run at a specific miunte, use 0-59. For example if you want to run at 15,30,45 then you would enter 15,30,30 in the minutes field. The whole cronjob would look like
15,30,30 * * * *
Hour: Similar to minutes, to run at regular hour interval. */x
To run at a specific hour; then use 0-23 in the hours field
Day: To run on every day, use
To run on every 2 days, use
To run at a specific day, use 0-30/31 (depending on the month). For example if you want to run at the 1st and the 15th of everything. It would be
Month: To run every third month
To run on January and September.
To run on specific month. Use
Weekday: Weekday, use
Monday, Thursday, Saturday, use
Run on specific day, use the variable
Command: This is where you fill in the command you want to run. Remember you will have to call the script’s binary file first. For example, to run a PHP file you would have to call the PHP binary (/usr/local/bin/php)
4) The follow is an example to run the script located in /home/demodomain/public_html/cronjob.php .
At every 15,45th minute, every 2 hours, on the 10th, 20th and 30th day of the month, every month.