[tissue](/) · [tools](/tools/) · cron expression explainer

# Cron expression explainer

Paste a crontab schedule and read it in plain words, with the next ten times it runs. It reads the five standard fields the way cron does, day-of-month quirks included, and it all happens in your browser.

Cron expression

`30 3 * * 1-5`

Explain

Minute, hour, day of month, month, day of week. Try [every 15 minutes](/tools/cron/?e=*%2F15+*+*+*+*), [weekdays at nine](/tools/cron/?e=0+9+*+*+mon-fri), [the 1st and every Monday](/tools/cron/?e=0+0+1+*+mon) or [@weekly](/tools/cron/?e=%40weekly).

At 03:30, Monday through Friday.

Times are read on a UTC clock.

## The five fields of a cron expression

Read left to right, separated by spaces.

| Field | Values | Names |
| --- | --- | --- |
| Minute | 0 to 59 |   |
| Hour | 0 to 23 |   |
| Day of month | 1 to 31 |   |
| Month | 1 to 12 | `jan` to `dec` |
| Day of week | 0 to 7, Sunday is 0 and 7 | `sun` to `sat` |

Names are case-insensitive, and the full names work too (`monday`, `january`). `0 3 * * *` is 03:00 every day; `30 3 * * 1-5` is 03:30 on weekdays.

## What \* , - and / mean

- **`*`** — Every value the field can take. In the two day fields, `?` means the same.
- **`,`** — A list: `0,30` in the minute field is on the hour and at half past.
- **`-`** — A range, both ends included: `9-17` in the hour field is nine in the morning through five in the afternoon. `mon-fri` works, and a range has to run forwards.
- **`/`** — A step. `*/15` in the minute field is 0, 15, 30 and 45. `5/15` starts at 5 and runs to the end of the field: 5, 20, 35, 50. `1-10/3` is 1, 4, 7, 10. A step counts from the start of the range, so `*/7` in the day-of-month field is the 1st, 8th, 15th, 22nd and 29th, and then the 1st again.

## When day of month and day of week are both set

If both day fields are restricted, cron runs on a day that matches *either* of them. `0 0 1 * mon` isn't "the 1st, if it's a Monday". It's midnight on the 1st of every month and midnight every Monday.

If either field starts with `*`, the two are combined the other way, and a day has to match both. That's why `0 0 1-7 * */7` runs on the first Sunday of the month (`*/7` in the day-of-week field is 0 and 7, which are both Sunday), while `0 0 1-7 * 0` runs on the first seven days of the month and every Sunday as well.

## What standard cron doesn't take

Some schedulers add their own syntax: `L` for the last day of the month, `W` for the nearest weekday, `5#3` for the third Friday, a sixth field for seconds or for the year. A crontab doesn't understand any of those, so the explainer refuses them and says why. It reads `@hourly`, `@daily`, `@weekly`, `@monthly` and `@yearly` and shows the five fields each one stands for. `@reboot` has no schedule to show.

A step longer than its field, like `*/90` in the minute field, is refused too. Some parsers accept it and run only at the start of the field, once an hour, which is rarely what was meant.

Tissue Cloud's own scheduler, pulse, reads the same five fields with one difference: day of week counts from 1 for Sunday, so Monday is `2`. Its [overview](https://docs.tissue.systems/docs/pulse/overview/) has the details.

## Cron and time zones

Cron runs on the clock of the machine it's on. A server set to UTC reads `0 9 * * *` as 09:00 UTC, which is the middle of the night in California. This page reads every expression on a UTC clock and shows each run in UTC and in your browser's time zone side by side.

On a machine that follows daylight saving time, cron daemons differ in what they do with a job in the hour the clocks skip or repeat. Scheduling outside about 01:00 to 03:00 local time avoids the question.

## Find out when a cron job doesn't run

A cron job that stops running doesn't send an error. It just stops, and you find out when you need the backup. Tissue Mast turns that silence into a page with a [heartbeat](/mast/docs/heartbeats/): the job checks in when it finishes, and a missed check-in pages your phone through Mast Pager.

```
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://mast.tissue.dev/mk_0c47e2a91d
```

A heartbeat takes the same crontab line you checked above, with its time zone and some grace for how late is still fine. Put the exit status on the end of the URL, `/$?`, and a failed run pages at once instead of waiting to be missed.

Free covers ten heartbeats, ten probes and ten alert sources, with an email address and no credit card. [Watching a cron job](/mast/docs/start-cron/) takes two minutes.

[Create a free account](/mast/signin/?new) Ten heartbeats on Free, no credit card.

## Read more

- [watch a cron job](/mast/docs/start-cron/)
- [heartbeats in full](/mast/docs/heartbeats/)
- [run signals](/mast/docs/run-signals/)
- [the other free tools](/tools/)
