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 serves purposes such as: 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. Look for the "Advanced" section
  3. Click on "Cron Jobs"
  4. In "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/yourusername/public_html/wp-cron.php

Run a PHP script every hour:

/usr/local/bin/php /home/yourusername/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 yourusername with your actual cPanel username. You can find it in the upper right corner of cPanel.