Setting up cron jobs in cPanel.

Schedule scripts to run automatically — backups, cleanups, batch jobs. Includes safe-defaults and how to debug a cron that doesn't fire.

2 MIN READ

cron is the unix scheduler. cPanel exposes it via a friendly form. Use it to run scripts on a schedule.

Creating a cron job

  1. cPanel → Cron Jobs
  2. Optionally set Cron Email at the top — output of your cron jobs gets emailed here. Leave empty to silence.
  3. Pick a schedule from the dropdown (Once an hour / Once a day / etc.) or fill the 5 fields manually
  4. Type the command
  5. Add New Cron Job

Schedule format

Five fields: minute, hour, day of month, month, day of week.

*/15 * * * *     command   # every 15 minutes
0 3 * * *        command   # daily at 3 AM
0 */6 * * *      command   # every 6 hours
0 0 * * 1        command   # Mondays at midnight

Use crontab.guru to verify a schedule before saving. Easy to get wrong.

Common commands

WP-CLI cron event runner (replaces WordPress's traffic-triggered cron):

/usr/local/bin/php /home/user/public_html/wp-cron.php > /dev/null 2>&1

Custom PHP script:

/usr/local/bin/php /home/user/scripts/cleanup.php

Backup script:

/home/user/scripts/backup.sh

curl a URL (for triggering app endpoints):

curl -s "https://yourdomain.com/api/cron/process" > /dev/null

> /dev/null 2>&1

These suffix tokens silence stdout (> /dev/null) and stderr (2>&1). Without them, cron emails you the output of every run — gets old fast.

For debugging, leave them off and check email. For production, add them once you trust the job.

PHP version for cron

cron uses the system default PHP, which may differ from your domain's per-domain PHP. To force a specific version:

/opt/cpanel/ea-php83/root/usr/bin/php /home/user/script.php

Replace php83 with the version you want.

WordPress cron — disable WP's built-in trigger

WordPress fires its cron on every page request, which is slow and unreliable. Better:

  1. Add to wp-config.php: define('DISABLE_WP_CRON', true);
  2. Set up a real cron job that runs wp-cron.php every 15 minutes

This decouples cron from page traffic. Cron runs reliably even on low-traffic days.

Cron not running — diagnostic

  1. Check Cron Jobs page — is it listed?
  2. Set Cron Email at top, save, wait for next scheduled run, check inbox
  3. If email shows the output, your command works. If silent, your command is failing silently — check paths.
  4. Test the command manually via SSH first:
    /usr/local/bin/php /home/user/script.php
    If this fails in SSH, it'll fail in cron too. Fix it in SSH, then add to cron.

Limits

We allow up to 50 cron jobs per cPanel account. Rate limit is 1 minute minimum interval — schedules like * * * * * (every minute) are fine.

For sub-minute scheduling or job orchestration with retries/dependencies, consider running a small queue worker instead (Beanstalkd, Laravel Horizon, or a Node.js process under Passenger).

Still stuck?

Chat with a real engineer — median response under 3 minutes, any time of day.

Contact support