A cron job runs a command automatically on a schedule. They are commonly used for CMS scheduled tasks, sending queued emails, clearing caches, or running custom scripts.
Where to Find Cron Jobs
- Log in to cPanel.
- Open the Cron Jobs tool under the Advanced section.
Setting the Schedule
The schedule uses five time fields: minute, hour, day, month, and weekday. cPanel provides common presets, but you can also enter values directly.
* * * * * command (every minute)
0 * * * * command (every hour)
0 2 * * * command (every day at 2am)
For most CMS tasks, every 5 or 15 minutes is enough. Avoid running heavy jobs every minute on shared hosting, as that can hit resource limits.
Adding the Command
In the Command field, enter the command to run. Two common examples:
- A PHP script:
php /home/username/public_html/script.php - A URL trigger using wget:
wget -q -O /dev/null https://yoursite.co.ke/cron.php
Replace username and the path with your own values, which you can find in File Manager.
Verifying It Runs
- Add a log line to your script so you can confirm it executed.
- Check back after the scheduled time has passed.
- If you want email confirmation, set a notification address at the top of the Cron Jobs page.
If your cron job does not run, double-check the file path, the PHP binary, and that the script has no errors. For help with the exact command, contact support through the /contact page.