What is a Cron Job?
A Cron Job is a task that runs automatically on your server at defined intervals. It is used for things like: sending scheduled emails, cleaning databases, generating reports, synchronizing data, or running the WordPress queue system.
How to Create a Cron Job in cPanel
- Log in to cPanel
- Find the "Advanced" section
- Click on "Cron Jobs"
- Under "Add New Cron Job" define the execution interval
- In the "Command" field, type the command to execute
- Click on "Add New Cron Job"
Examples of Useful Commands
WordPress — Run wp-cron every 5 minutes:
/usr/local/bin/php /home/tuusuario/public_html/wp-cron.php
Run a PHP script every hour:
/usr/local/bin/php /home/tuusuario/public_html/my-script.php
Configure the Time Interval
- Every minute:
* * * * * - Every 5 minutes:
*/5 * * * * - Every hour:
0 * * * * - Every day at midnight:
0 0 * * * - Every Monday:
0 0 * * 1
???? Tip: Replace
tuusuario with your actual cPanel username. You can find it in the top right corner of cPanel.