A cron job is a command or script that your server runs automatically on a set schedule.

A cron job is a scheduled task on a Linux server. You tell the server "run this command at this time", and it does so automatically, whether that's every five minutes, every night at 2am or on the first day of each month. The name comes from cron, the program that keeps track of the schedule.

For example, an online shop might run a cron job every hour to send abandoned cart emails, and another each night to clear out old log files. You set it once and the server takes care of it.

How a cron job schedule works

Each cron job has a schedule made of five fields, followed by the command:

  • Minute (0 to 59)
  • Hour (0 to 23)
  • Day of month (1 to 31)
  • Month (1 to 12)
  • Day of week (0 to 6, where 0 is Sunday)

An asterisk means "every". So */15 * * * * runs every 15 minutes, and 0 3 * * 1 runs at 3am every Monday. In cPanel, the Cron Jobs page has drop-downs for common schedules, so you don't need to memorise the format.

Common uses for cron jobs

  • Running scheduled tasks for apps like WordPress, Magento or Laravel.
  • Sending newsletters or queued emails.
  • Creating database exports or extra backups.
  • Importing product feeds or syncing data with another service.
  • Clearing caches and temporary files.

WordPress cron vs a real cron job

WordPress has its own scheduler, WP-Cron, but it only runs when someone visits your site. On a quiet site, scheduled posts can publish late. On a busy site, it checks on page loads far more often than needed, which adds overhead.

The usual fix is to disable WP-Cron by adding define('DISABLE_WP_CRON', true); to wp-config.php, then create a real server cron job that calls wp-cron.php every 5 to 15 minutes.

Common cron job problems

  • Wrong path: cron doesn't run from your website folder, so use full paths to PHP and to your script.
  • Too frequent: running a heavy task every minute can push your account into its resource usage limits.
  • Overlapping runs: if a job takes longer than its interval, copies pile up. Add a lock or run it less often.
  • Email floods: by default, cron emails its output after every run. Add >/dev/null 2>&1 to the end of the command to silence it once it's working.
  • Time zone confusion: the server's clock may not match your local time.

AblePage includes SSH, SFTP and cron access on every plan.

Cron job questions

How do I set up a cron job in cPanel?
Open Cron Jobs in cPanel, choose a schedule from the drop-downs or enter it manually, paste in the command and click Add New Cron Job.
How often can a cron job run?
Once a minute is the shortest interval standard cron supports. Some hosts set a longer minimum, such as every 5 or 15 minutes.
Should I disable WP-Cron?
Yes, on most sites. Replacing it with a real server cron job makes scheduled tasks more reliable and reduces load on every page view.
Was this definition helpful?
Share this definition