8 min
How to Set Up a Cron Job
cPanel Cron Jobs, crontab syntax, wp-cron and PHP automation.
BeoHosting Team
10+ years of experience — Web hosting and infrastructure specialists
- Hosting
- WordPress
- cPanel
- SEO
- Security
- Domains
Last updated:
Cron jobs run scripts on a schedule — every minute, hourly, daily, or on specific days. They power backups, email queues, WordPress scheduled posts, cache cleanup and countless other automation tasks. This guide shows how to add a cron job in cPanel, how the crontab syntax works (* * * * *), and how to replace WordPress's unreliable wp-cron with a real server cron.
How to Set Up a Cron Job
Open Cron Jobs in cPanel
cPanel → Advanced → Cron Jobs. You see existing crons and a form to add new ones. cPanel hosts (BeoHosting included) allow unlimited crons on most plans.
Understand the cron syntax
Five fields: minute (0-59), hour (0-23), day-of-month (1-31), month (1-12), day-of-week (0-6, Sun=0). * means "every". Examples: "0 * * * *" = every hour at minute 0. "*/5 * * * *" = every 5 minutes.
Add a cron via the cPanel shortcuts
Use the "Common Settings" dropdown — "Once per hour", "Once per day" pre-fill syntax. Then type the command, e.g. /usr/local/bin/php /home/user/public_html/script.php.
Replace WP-Cron with a real cron
WordPress's default wp-cron runs on every page visit — unreliable. Disable it: add define('DISABLE_WP_CRON', true); to wp-config.php. Then add cron: */5 * * * * curl -s https://yourdomain.com/wp-cron.php?doing_wp_cron > /dev/null.
Common cron tasks
Backups: 0 3 * * * /path/backup.sh. Send pending emails: */10 * * * * /usr/local/bin/php /path/send-mail.php. Clear cache: 0 4 * * * /path/clear-cache.sh. Sync product feed: 0 */6 * * * /path/sync-feed.php.
Email notifications and debugging
cPanel Cron Jobs has an Email field — set it to receive output. To suppress emails on success: add > /dev/null 2>&1. To log to a file: > /home/user/cron.log 2>&1.
Ready to launch your website?
Join 4,000+ satisfied customers. Free migration and 15-day money-back guarantee.
FAQ
Answers to the most common questions about our services.
Our guarantees for your peace of mind
Protected from every angle
15-day guarantee
We refund without questions in the first 15 days.
Free migration
We migrate your site with no downtime — you do nothing.
24/7 support
Our experts are here 24/7 via tickets and live chat.