What Is a Cron Job?
Reviewed by Ionut Caval · Updated August 2026
A cron job is a command or script that a Unix-like system runs automatically on a fixed schedule, defined by a five-field time expression. The scheduler itself is a background service called cron, and the file listing the jobs is the crontab (cron table).
Cron has scheduled work on Unix systems since the 1970s and remains the default way to automate recurring tasks on Linux servers: nightly database backups, log rotation, cache warming, report generation, certificate renewal. The daemon wakes every minute, compares the current time against every scheduled entry, and runs whatever matches.
The five fields
Each crontab line begins with five time fields, then the command to run. Read left to right, they are minute, hour, day of month, month, and day of week:
- Minute (0 to 59)
- Hour (0 to 23, so 24-hour clock)
- Day of month (1 to 31)
- Month (1 to 12, or names such as JAN)
- Day of week (0 to 7, where both 0 and 7 mean Sunday, or names such as SUN)
An asterisk means "every value". So 0 3 * * * runs at 03:00 every day, and */15 * * * * runs every fifteen minutes. You can build and decode these expressions with the free cron expression generator.
Why cron jobs fail quietly
Cron is reliable at starting jobs and says nothing about whether they worked. A job that exits with an error, hangs forever, or never starts because the daemon stopped produces no alert at all. Cron mails output to the account that owns the crontab, which on a modern server usually means it is discarded, because no mail transfer agent is installed.
The failure mode is therefore silence, and silence looks exactly like success. Backups that stopped running three weeks ago are typically discovered when someone needs a backup. This is the gap that heartbeat monitoring closes: the job reports in when it finishes, and the absence of that report is what raises the alert. Pulsetic calls this cron job monitoring, and it is the inverse of a normal health check, since it alerts on nothing arriving rather than on something responding badly.
Cron beyond the crontab
The five-field syntax outlived the original program. Kubernetes CronJob objects use it, as do most cloud schedulers and job libraries in Python, PHP, Ruby and Java. On modern Linux distributions, systemd timers cover much the same ground with better logging and dependency handling, though plain cron remains far more common because it is simpler and available everywhere.
See also: Cron expression generator
Frequently asked questions
-
What is the difference between cron, crontab and a cron job?
Cron is the background service that runs on a schedule. A crontab is the file listing what should run and when. A cron job is a single entry in that file, meaning one command on one schedule.
-
How do I create a cron job?
Run "crontab -e" to open your personal crontab in an editor, add a line with five time fields followed by the command, then save. Use "crontab -l" to list your jobs. Changes take effect without restarting anything.
-
What is the shortest interval a cron job can run at?
One minute. Cron evaluates its schedule once per minute, so it cannot run anything more frequently. Sub-minute work needs a loop inside the script, a systemd timer, or a long-running worker process instead.
-
Why did my cron job work manually but not from cron?
Almost always the environment. Cron runs with a minimal PATH and does not read your shell profile, so commands that work in your terminal may not be found. Use absolute paths for both the interpreter and the script, and set any variables the job needs inside the crontab itself.
-
How do I know whether a cron job actually ran?
Cron itself will not tell you. Check the system log (/var/log/syslog on Debian and Ubuntu, /var/log/cron on RHEL and Fedora) to confirm it started, redirect the job output to a log file to see what it did, and use heartbeat monitoring to be alerted when an expected run does not happen at all.
-
Put these metrics to work. Monitor your site free.
2-minute setup · Cancel any time
-
No credit card needed