If you’d like to run a script on your website at specified intervals, you can just setup a CRON job and it will run your script automatically at that time. Here’s how you set it up:
-
Login to your cPanel

-
Scroll down to Advanced section
-
Click on "CRON jobs"
-
Set the time interval for which you’d like to run your CRON job Note: Cron jobs with frequency of less than 15mins will default to 15mins to prevent crons from using up precious server resources
- Enter the command to eun your script:
For example, to run a PHP script at an interval, set the command as: php /home/username/public_html/cron.php (where cron.php is your PHP file) If you’d like to see more such examples, Click Here
- Click on "Add New Cron Job"

That's it. Just sit back and relac and the cron job will run automatically to run your script at regular intervals.
|