A cron job is a scheduled task that automatically runs a command or script at set intervals — for example, to run daily backups, send scheduled emails, or clear temporary files — without requiring you to do it manually.
Create a Cron Job
To create a cron job:
- Log into cPanel.
- In the Advanced section, click Cron Jobs.
- Under Cron Email, make sure the current email address is valid. If not, enter a new, valid email and click Update Email. You will receive an email after the cron job has finished.
- Under Add New Cron Job, use the Common Settings drop-down menu to choose from a list of regularly used intervals; or set the frequency of your cron job by using the drop-down box next to each time unit. Common settings range from every minute to once a year.
- In the Command field, enter the desired command.
- Click Add New Cron Job.
Example: Running a PHP script every day at 2:00 AM:
/usr/local/bin/php /home/username/public_html/cron.php
Tip: Always use the full absolute path to both the program and the script (e.g. /usr/local/bin/php, not just php), since cron jobs run in a limited environment and may not recognize shortcuts that work in your terminal or browser.
Tip: If you don’t want to receive an email every time the job runs successfully, add > /dev/null 2>&1 to the end of your command. This suppresses normal output while still allowing cron to report genuine errors if the job fails to run at all.
Need a schedule the Common Settings don’t cover? See our Cron Job Syntax Cheat Sheet for custom scheduling using minute/hour/day/month fields.
Remove or Edit a Cron Job
To remove or edit a cron job:
- In the Advanced section of cPanel, click the Cron Jobs icon.
- Scroll down to the last section called Current Cron Jobs.
- Find the cron job you wish to edit or delete.
- Under Actions, for the appropriate cron job, click either Edit or Delete.
