Configure Scheduled Tasks (Cron Jobs)

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

  1. Log in to cPanel
  2. Find the "Advanced" section
  3. Click on "Cron Jobs"
  4. Under "Add New Cron Job" define the execution interval
  5. In the "Command" field, type the command to execute
  6. 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.