Cron Job in cPanel with PHP
Running PHP scripts automatically can have some big benefits. You can wait to have things get done when there is less traffic on your server, or you can ensure daily tasks get done on time.
cPanel Simple Cron
Even if you do not know anything about cron jobs, and have never run a cron job before - you can get started with the simple cron tool built into cPanel. The url for it is:
A few things you'll need is the path to php and the path to the script that you'll be running. You will need the full path to do this. If your path to PHP differs then the one below, then change it - otherwise keep it as is. Don't know the path? This is most likely correct for you, just keep an eye out to see if the script does indeed run.
The command to run:
/usr/local/bin/php -f /home/(username)/public_html/(scriptname).php
Next you'll want to select an option from all the select boxes. Remember to select an option in each box. If you want something to run every day at 4AM, select Minute: 0; Hour: 4; Day: Every; Month: Every; Weekday: Every;
Click save and you are all set! You'll get an email every time the cron job runs, but if you don't want to get it - put :blackhole: into the output email field at the top.
This scene happens at the Roxbury theme one night back in 90's. The original video can be found at YouTube.