What it is
Cron is the scheduler that has been part of Unix since the 1970s. It reads a table of jobs — the crontab — and runs each command when its schedule comes round. That is the whole idea.
What people use it for, in practice: nightly backups, clearing temp files, importing a supplier feed, sending invoice reminders on the first of the month, renewing certificates, and driving WordPress's scheduler properly.
The five fields
┌───────────── minute (0 - 59)
│ ┌─────────── hour (0 - 23)
│ │ ┌───────── day of month (1 - 31)
│ │ │ ┌─────── month (1 - 12)
│ │ │ │ ┌───── day of week (0 - 6, Sunday = 0)
│ │ │ │ │
* * * * * /usr/bin/php /home/user/script.php
Four operators, and that is the entire syntax:
*— every value.* * * * *is every minute.,— a list.0 9,17 * * *is 9am and 5pm.-— a range.0 9-17 * * *is hourly from 9am to 5pm./— a step.*/15 * * * *is every fifteen minutes.
Common cron expressions
Jump to: every 5 minutes · every 15 minutes · every hour · daily · weekly · monthly · list cron jobs · cron job not running
| Expression | Runs |
|---|---|
* * * * * | Every minute — the shortest interval cron allows; use it for testing |
*/5 * * * * | Every 5 minutes, at :00, :05, :10 and so on |
*/10 * * * * | Every 10 minutes |
*/15 * * * * | Every 15 minutes — the usual WP-Cron replacement |
*/30 * * * * | Every 30 minutes, at :00 and :30 |
0 * * * * | Every hour, on the hour |
0 */6 * * * | Every 6 hours: midnight, 6am, noon and 6pm |
30 2 * * * | 2:30am daily — the classic backup slot |
0 0 * * * | Daily at midnight |
0 9 * * 1-5 | 9am on weekdays only |
0 3 * * 0 | 3am every Sunday |
0 0 1 * * | Midnight on the first of every month |
A step counts from the start of its range, not from when you saved the job: */5 in the minute field always fires at :00, :05, :10 and so on through :55. To run every 5 minutes but start at :02 instead, write 2-59/5 * * * *. Most crons also accept shortcuts such as @hourly, @daily, @weekly and @reboot, which save typing but are harder to read at a glance in a long crontab.
Cron runs in the server's timezone. On our servers that is IST, so 30 2 * * * is 2:30am in India, not UTC. Check with date before you assume.
Setting one up in cPanel
- cPanel → Cron Jobs.
- Put an address in Cron Email. Cron mails you anything the command prints, which is how you find out it has been failing for three weeks.
- Pick a Common Setting, or type the five fields yourself.
- Enter the command with absolute paths:
/usr/local/bin/php /home/username/public_html/cron.php - Add the job, then wait for the first run and check the mail.
To silence a job that works and prints noise, append >/dev/null 2>&1 — but only once you have seen it succeed.
On a VPS
# edit your own crontab
crontab -e
# list what is scheduled
crontab -l
# run as another user
sudo crontab -u www-data -e
System-wide jobs live in /etc/cron.d/ and take an extra field — the user to run as — between the schedule and the command. That difference catches people out constantly. If your jobs are heavy and run all day, such as big imports or reports, a Bigdomainhost VDS reserves whole physical cores for you, so run times stay steady.
How to list cron jobs in Linux
There is no single command that shows every scheduled job on a server, because cron reads from several places. To check cron jobs properly, look at each:
# your own jobs
crontab -l
# another user's jobs (needs root)
sudo crontab -u www-data -l
# every user's crontab at once
sudo ls /var/spool/cron/crontabs/ # Debian and Ubuntu
sudo ls /var/spool/cron/ # AlmaLinux and Rocky
# system-wide jobs
cat /etc/crontab
ls /etc/cron.d/ /etc/cron.hourly/ /etc/cron.daily/ /etc/cron.weekly/ /etc/cron.monthly/
crontab -l answering "no crontab for user" does not mean nothing runs — the job may sit in /etc/cron.d/ or belong to another user. On a modern distribution, also run systemctl list-timers: some scheduled work is a systemd timer rather than a cron entry. In cPanel, the Cron Jobs page lists the account's jobs under Current Cron Jobs, where you can edit or delete each one.
Cron job not running? The four usual reasons
First rule out the obvious: if no job on the server runs at all, the cron daemon itself may be stopped. Check it with systemctl status cron on Debian and Ubuntu, or systemctl status crond on AlmaLinux and Rocky. If the daemon is running and only your job is silent, it is almost always one of these four.
1. Relative paths
Cron runs your job from your home directory, not the folder you tested it in, and does not have your shell's PATH. php script.php fails; /usr/local/bin/php /home/user/script.php works. Find the binary with which php and use what it prints.
2. A missing environment
Your interactive shell loads .bashrc; cron does not. Anything that depends on an environment variable needs it set in the crontab itself:
PATH=/usr/local/bin:/usr/bin:/bin
30 2 * * * /home/user/backup.sh
3. The script is not executable
chmod +x /home/user/backup.sh, and make sure the first line is a shebang: #!/bin/bash.
4. An unescaped percent sign
The one nobody guesses. In a crontab, % means a newline. A command containing date +%Y-%m-%d is silently cut off at the first percent. Escape every one as \%.
WordPress: replace WP-Cron
WordPress's scheduler is not cron. It fires when someone loads a page, so on a quiet site scheduled posts do not publish and backups do not run — and on a busy site it fires on every page load, which is its own problem.
Fix both at once. In wp-config.php:
define('DISABLE_WP_CRON', true);
Then add a real cron job every fifteen minutes:
*/15 * * * * /usr/local/bin/php /home/user/public_html/wp-cron.php >/dev/null 2>&1
This is one of the highest-value five-minute changes on a WordPress site, and it is covered in more depth in our WordPress speed guide.
Debugging one that has gone quiet
- Check the cron log —
/var/log/syslogon Ubuntu,journalctl -u cronon Debian 12 and later,/var/log/cronon AlmaLinux and Rocky. - Redirect output to a file and read it:
>> /home/user/cron.log 2>&1. - Run the exact command by hand first. If it fails interactively, cron was never the problem.
- Test with
* * * * *so you find out in a minute rather than tomorrow, then set the real schedule.
Cron jobs are available on every plan we sell, from Web & cPanel hosting upwards. If one will not behave, call +91 75994 50220 and we will look at it with you.
Sources (checked )
- man7.org: crontab(5): Linux manual page
- cPanel & WHM Documentation: Cron Jobs
How Bigdomainhost can help
For scheduled jobs you control end to end, a KVM VPS gives you full root access, so every crontab command and systemd timer above works as written. Servers run on NVMe in Mumbai or Delhi NCR, a Linux VPS is usually ready in under 60 seconds, and billing is in 30-day periods with no setup fee. If a job has gone quiet and you cannot see why, our engineers answer WhatsApp at any time and the phone in IST hours.