---
title: "Cron syntax cheat sheet: fields and examples"
url: "https://cronmissed.com/learn/cron-syntax-cheat-sheet.md"
canonical_url: "https://cronmissed.com/learn/cron-syntax-cheat-sheet"
last_updated: "2026-11-10"
type: "conceptual"
summary: "The five cron fields, the characters * , - and /, the @daily style shortcuts, the day field rule and ten expressions to copy, each checked."
related: ["https://cronmissed.com/learn.md", "https://cronmissed.com/tools/cron-explainer.md", "https://cronmissed.com/cron.md", "https://cronmissed.com/tools/cron-generator.md", "https://cronmissed.com/learn/what-is-a-cron-job.md", "https://cronmissed.com/cron/quartz-and-spring.md"]
---

# Cron syntax cheat sheet: fields and examples

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

The five cron fields, the characters * , - and /, the @daily style shortcuts, the day field rule and ten expressions to copy, each checked.

Cron syntax is five fields separated by spaces: minute, hour, day of the month, month and day of the week, followed by the command to run. A star matches every value, and lists, ranges and steps pick some of them. This page holds the whole grammar in tables you can scan.

## What are the five cron fields?

| Field | Allowed values | Notes |
| --- | --- | --- |
| Minute | 0-59 | The minute of the hour the job starts. |
| Hour | 0-23 | A 24-hour clock in the scheduler's time zone. |
| Day of the month | 1-31 | A day that the month does not have, such as 31 in April, is skipped. |
| Month | 1-12 or JAN-DEC | Names are not case sensitive. |
| Day of the week | 0-7 or SUN-SAT | 0 and 7 both mean Sunday. |

A crontab line is these five fields, then the command. A line such as `30 2 * * 1-5 /usr/local/bin/backup.sh` runs the script at 02:30 on Monday to Friday. The [cron expression translator](https://cronmissed.com/tools/cron-explainer.md) reads any line back in plain English.

## What do the special characters mean?

| Character | Meaning | Example |
| --- | --- | --- |
| `*` | Every value of the field. | `* * * * *` runs every minute. |
| `,` | A list of values. | `0 8,12,18 * * *` runs at 08:00, 12:00 and 18:00. |
| `-` | An inclusive range. | `0 9-17 * * *` runs at the start of every hour from 09:00 to 17:00. |
| `/` | A step through a range, or through the whole field after a star. | `*/15 * * * *` runs every 15 minutes, and `10-40/10 * * * *` runs at minutes 10, 20, 30 and 40. |

Combine them freely inside one field: `1-5,10-15/5` means 1 to 5, then 10, 15. A step counts from the start of its range, so `*/20` in the minute field runs at 0, 20 and 40, not every 20 minutes since the last run.

## Which shortcuts does cron accept?

| Shortcut | Same as | When it runs |
| --- | --- | --- |
| `@yearly` | `0 0 1 1 *` | Once a year, at midnight on 1 January. Also written @annually. |
| `@monthly` | `0 0 1 * *` | Once a month, at midnight on the first. |
| `@weekly` | `0 0 * * 0` | Once a week, at midnight at the start of Sunday. |
| `@daily` | `0 0 * * *` | Once a day, at midnight. Also written @midnight. |
| `@hourly` | `0 * * * *` | Once an hour, at minute 0. |

`@reboot` is different. It has no schedule: it runs once, when the cron daemon starts, usually at boot. Because it has no times to expect, a heartbeat check cannot watch it the way it watches a schedule. Not every scheduler reads these shortcuts, so check yours before you rely on one.

## How do the day of the month and the day of the week combine?

```crontab
0 9 1 * 1
```

When both day fields are restricted, standard Unix cron runs the job when either one matches. The line above does not mean "the first, if it is a Monday". It runs at 09:00 on the first of every month and also at 09:00 on every Monday. If you want only a Monday that falls on the first, schedule the job for every Monday and test the date in the script.

If one of the two fields is a star, the other alone decides. That is why `0 9 * * 1` is every Monday and `0 9 1 * *` is the first of the month. Some schedulers treat the two fields differently, and Quartz requires a `?` in one of them; see [Quartz and Spring cron](https://cronmissed.com/cron/quartz-and-spring.md).

## Which cron expressions are worth copying?

| Expression | Runs |
| --- | --- |
| `* * * * *` | Every minute. |
| `*/5 * * * *` | Every 5 minutes. |
| `0 * * * *` | At the start of every hour. |
| `0 0 * * *` | Every day at midnight. |
| `30 2 * * 1-5` | At 02:30 on weekdays. |
| `0 9 * * 1` | At 09:00 every Monday. |
| `0 */6 * * *` | Every 6 hours, at 00:00, 06:00, 12:00 and 18:00. |
| `0 0 1 * *` | At midnight on the first of every month. |
| `15 3 * * 0` | At 03:15 every Sunday. |
| `0 0 1 1 *` | At midnight on 1 January. |

Each of these has its own page with the next runs and the daylight saving behavior in the [cron expression examples](https://cronmissed.com/cron.md). To build a line from pickers instead, use the [crontab generator](https://cronmissed.com/tools/cron-generator.md).

## Can you use names for months and weekdays?

Yes, in Unix cron. `0 8 * * MON-FRI` is the same as `0 8 * * 1-5`, and `0 0 1 JAN *` is the same as `0 0 1 1 *`. Sunday is both 0 and 7, which is why a range such as `5-7` ends on Sunday.

## How do you make sure the line really ran?

A crontab line gives no sign that it ran. Add a request to the end of the command, joined with `&&` so that it is sent only after a successful run, and give it a timeout so that a lost request cannot hang the job:

```crontab
30 2 * * 1-5 /usr/local/bin/backup.sh && curl -fsS --max-time 10 --retry 5 -o /dev/null https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10
```

CronMissed expects that request on the schedule in the line and alerts you when it is late. [What is cron job monitoring?](https://cronmissed.com/learn/cron-job-monitoring.md) explains the idea.

## Questions

### What is the order of the fields in a cron expression?

Minute, hour, day of the month, month, day of the week. Remember it as small to large, then the weekday last.

### Is there a field for seconds or for the year?

Not in standard Unix cron. Quartz and Spring add a leading seconds field, and Quartz accepts an optional year. A line with six or seven fields is not a Unix cron line, and CronMissed checks accept the five-field form.

### How do I run a job every 30 seconds with cron?

You cannot with one line, because the smallest unit is a minute. Two lines, one of them starting with sleep 30, do it; see [cron every 30 seconds](https://cronmissed.com/learn/cron-every-30-seconds.md).

## Sources

- [crontab(5) manual page](https://man7.org/linux/man-pages/man5/crontab.5.html), read 22 October 2026
- [cron(8) manual page](https://man7.org/linux/man-pages/man8/cron.8.html), read 22 October 2026

## Related pages

- [/tools/cron-explainer](https://cronmissed.com/tools/cron-explainer.md)
- [/cron](https://cronmissed.com/cron.md)
- [/tools/cron-generator](https://cronmissed.com/tools/cron-generator.md)
- [What is a cron job](https://cronmissed.com/learn/what-is-a-cron-job.md)
- [/cron/quartz-and-spring](https://cronmissed.com/cron/quartz-and-spring.md)

## Related

- [Cron monitoring explained: concepts and fixes](https://cronmissed.com/learn.md)
- [Cron expression translator and evaluator](https://cronmissed.com/tools/cron-explainer.md)
- [Cron expression and crontab examples](https://cronmissed.com/cron.md)
- [Crontab generator and cron dialect converter](https://cronmissed.com/tools/cron-generator.md)
- [What is a cron job? A plain explanation](https://cronmissed.com/learn/what-is-a-cron-job.md)
- [Quartz and Spring cron expressions explained](https://cronmissed.com/cron/quartz-and-spring.md)
