

cPanel home → Advanced → Cron Jobs
Anatomy of the page
Add a cron job
Pick a preset from Common Settings
Or fill the timing fields by hand
- A number:
15(the 15th minute, hour, day, etc.) - A range:
1-5 - A list:
0,15,30,45 - A step:
*/10(every 10 minutes) *for “any value”
0 2 * * * is “minute 0 of hour 2, every day”, which means daily at 2:00 AM server time.Paste the command
USER with your cPanel username.Click Add New Cron Job
Common cron uses
WordPress: replace wp-cron.php with system cron
WordPress’s built-inwp-cron.php runs on every page request, which is wasteful on busy sites. The fix is two-step:
Disable wp-cron.php in wp-config.php
/* That's all, stop editing! */ line:Add a system cron to run wp-cron every 5 minutes
*/5 * * * * (every 5 minutes).Command:wp-cron.php for your install.Laravel scheduler
Laravel ships with a single cron entry that handles all the app’s scheduled tasks. Schedule:* * * * * (every minute).
Command:
schedule() definitions in app/Console/Kernel.php decide which tasks actually run.
Daily backup script
Schedule:0 3 * * * (3 AM daily).
Command:
Pitfalls
My cron isn't running
My cron isn't running
php (without a full path) often isn’t found. Always use the full path to the binary: /usr/local/bin/php for cPanel-managed PHP, or /opt/cpanel/ea-php83/root/usr/bin/php for a specific PHP version.Other things to check: file permissions on the script (chmod +x backup.sh), the script’s shebang line, and that the working directory is right (cd into it first if your script reads relative paths).I'm getting cron output emails I don't want
I'm getting cron output emails I don't want
/dev/null in the command itself:>/dev/null drops stdout, 2>&1 drops stderr too. Most production crons do this.Second, clear the Cron Email field at the top of the page to disable email entirely for all jobs. Less surgical, but if you don’t care about any cron output, simpler.The cron uses the wrong PHP version
The cron uses the wrong PHP version
/usr/bin/php), not your cPanel-selected version. To use the version you set in Select PHP Version, use /usr/local/bin/php (the cPanel wrapper). To pin a specific version, use the absolute path: /opt/cpanel/ea-php83/root/usr/bin/php (replace 83 with 82, 81, etc.).The cron behaves differently from when I run the same command in the browser
The cron behaves differently from when I run the same command in the browser
$_SERVER, no $_REQUEST, and getcwd() returns your home directory unless you cd first. If your script depends on web-only globals or relative paths, fix the script to handle CLI mode.Two crons of the same job started running at the same time and broke things
Two crons of the same job started running at the same time and broke things
flock to prevent overlap:-n means “skip this run if the lock is held”. The lock auto-releases when the previous run finishes.What's the minimum interval I can schedule?
What's the minimum interval I can schedule?
sleep and run that from cron once a minute, or look at supervisord for proper process management.
