Concepts

What is cron?

Cron is the program on Linux, macOS and other Unix-like systems that runs commands on a schedule: every 5 minutes, every night at 2 AM, every Monday. You describe when and what in one line, and cron does the rest.

Cron, crontab and cron job: three different things

WordWhat it is
cronThe background service (daemon) that runs scheduled commands. On Debian and Ubuntu it wakes up every minute and checks every stored crontab for jobs that are due.
crontabTwo things. The file that lists your scheduled jobs ("cron table"), and the command you use to edit it: crontab -e.
cron jobOne line in a crontab: a schedule followed by the command to run.

What a cron job looks like

# minute  hour  day-of-month  month  day-of-week   command
  30      2     *             *      *             /home/alice/backup.sh

That line means "at 02:30 every day, run backup.sh". The five time fields are defined by POSIX:

FieldAllowed values
Minute0-59
Hour0-23
Day of month1-31
Month1-12
Day of week0-6, 0 = Sunday (Debian, Ubuntu and cronie also accept 7 for Sunday, and names like mon)

A * means "every value". You can list values (1,15), give ranges (9-17) and steps (*/5 = every 5th value). Paste any line into the cron translator to see it in plain English with the next run times.

Examples

ScheduleMeaning
*/5 * * * *Every 5 minutes: how to
0 * * * *Every hour, on the hour: how to
0 2 * * *Every day at 2 AM: how to
0 9 * * 1-59 AM, Monday to Friday: how to
0 0 1 * *Midnight on the 1st of every month
@rebootOnce, when cron starts at boot (Linux cron): details

More in the examples library and the cheat sheet.

The three crontab commands you need

crontab -e    # edit your crontab (creates it if it doesn't exist)
crontab -l    # list your jobs
crontab -r    # remove your whole crontab

crontab -r deletes every job at once without asking. On Debian, Ubuntu and cronie-based systems (Fedora, RHEL), crontab -i -r asks for confirmation first. To delete one job instead, see how to edit a crontab.

Things that surprise people

  • Output goes to email. Anything a job prints is mailed to the crontab's owner (or to MAILTO). With no mail system installed it's thrown away. Redirect it to a file instead; see where cron logs go.
  • A tiny environment. Cron runs jobs with a minimal PATH (/usr/bin:/bin unless the crontab sets one), so commands that work in your terminal can fail with "command not found". Use full paths. More in cron environment variables.
  • Day fields are OR'd. If you set both day-of-month and day-of-week, the job runs when either matches. 0 0 1-7 * 1 runs on the 1st to 7th and every Monday, not "the first Monday". See the first-Monday trap.
  • % is special. An unescaped % in the command becomes a newline, so date +%F must be written date +\%F.
  • Server time, not your time. Jobs run in the system's time zone. See cron time zones.

Where cron runs

SystemCron
Debian, UbuntuDebian's cron (based on Paul Vixie's cron), service cron: set it up
Fedora, RHEL, Rocky, Alma, Amazon Linux, Archcronie (also based on Vixie cron), service crond
Alpine, many Docker imagesBusyBox crond
macOScron is still included, but Apple recommends launchd: crontab on Mac
WindowsNo cron; use Task Scheduler: cron on Windows

Many other tools borrowed the cron format: Kubernetes CronJobs, GitHub Actions, Jenkins cron (with its H hash), AWS EventBridge and Quartz (both with extra fields). They differ in small but important ways; the cron dialect registry compares them side by side.

Is cron the right tool?

Cron is ideal for simple, single-machine jobs. It won't retry a failed job, won't run a job it missed while the machine was off (that's what anacron is for), and won't tell you when something fails unless you add monitoring. On systemd Linux, systemd timers cover those gaps.

Sources

Checked against these official manuals and source code. Last verified 18 November 2026.