# Cron Expression

> Five fields that say when a scheduled job runs, like 0 3 * * *.

**Field:** Infrastructure  
**Category:** Linux & the Command Line  
**Also known as:** Cron Schedule, Cron Syntax, Crontab Syntax

## Think of it like

Think of it like a school timetable written in code. Each box says which day and hour.

## Definition

A cron expression is the time pattern in a cron job. It has five fields, in this order: minute, hour, day of the month, month and day of the week. A star means every value. So 0 3 * * * means minute 0 of hour 3, every day. Many tools beyond cron use the same five fields.

## Example

Jack wants a report at 9:30 on weekdays. He writes 30 9 * * 1-5, which means minute 30 of hour 9, Monday to Friday.

## Example code

```console
$ crontab -l
30 9 * * 1-5 /home/jack/report.sh
*/15 * * * * /home/jack/check.sh
```

The first job runs at 9:30 on weekdays. The second runs every 15 minutes.

## Why it matters

One wrong field can run a job every minute instead of once a day.

## Common mistake

Mixing up the order. The first field is the minute, not the hour.

## Three principles

- **Five fields.** Minute, hour, day, month, weekday.
- **Star means every.** Any value matches.
- **Minute first.** Not the hour.

## Related terms

- [Cron](https://learn.benibix.com/term/infrastructure/cron)
- [Daemon](https://learn.benibix.com/term/infrastructure/daemon)
- [systemd](https://learn.benibix.com/term/infrastructure/systemd)

## Taught in

- [Cron Jobs and Schedules](https://learn.benibix.com/learn/infrastructure-linux/cron-jobs-and-schedules): Linux CLI, 9/10

![The crontab line 30 9 * * 1-5 /home/jack/report.sh with each part labelled. 30 is the minute, 9 is the hour, the first star is any day of the month, the second star is any month, and 1-5 is Monday to Friday. The path after them is the command to run.](https://learn.benibix.com/diagrams/inf3-cron.svg)

---

Source: https://learn.benibix.com/term/infrastructure/cron-expression
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
