---
title: "systemd OnCalendar syntax and cron equivalents"
url: "https://cronmissed.com/learn/systemd-oncalendar-syntax.md"
canonical_url: "https://cronmissed.com/learn/systemd-oncalendar-syntax"
last_updated: "2026-11-26"
type: "conceptual"
summary: "Read and write systemd OnCalendar expressions: the date and time fields, shortcuts, cron lines converted to OnCalendar, the weekday rule and systemd-analyze."
related: ["https://cronmissed.com/learn.md", "https://cronmissed.com/learn/cron-vs-systemd-timers.md", "https://cronmissed.com/guides/systemd-timers.md", "https://cronmissed.com/tools/cron-generator.md", "https://cronmissed.com/learn/cron-syntax-cheat-sheet.md", "https://cronmissed.com/learn/cron-time-zones-and-dst.md"]
---

# systemd OnCalendar syntax and cron equivalents

> **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.

Read and write systemd OnCalendar expressions: the date and time fields, shortcuts, cron lines converted to OnCalendar, the weekday rule and systemd-analyze.

An OnCalendar expression has up to three parts, a weekday, a date and a time, written as `Mon..Fri *-*-* 09:00:00`. It sets when a systemd timer fires, the way five fields do for a crontab line. Most cron schedules translate directly, and `systemd-analyze calendar` shows when an expression will run before you rely on it.

## What is the format of an OnCalendar expression?

```format
DayOfWeek Year-Month-Day Hour:Minute:Second
```

- The weekday is optional. `Mon`, `Mon,Fri` and `Mon..Fri` all work.
- The date is `Year-Month-Day`, and the time is `Hour:Minute:Second`. Each part accepts `*` for every value, a list with commas, a range with `..` and a repeat with `/`.
- Leave out the time and it means midnight; leave out the date and it means every day.
- `*:0/15` is every 15 minutes, counting from minute 0 of every hour.

Because there is a seconds part, a timer can fire at a precise second. The cron monitor on this site accepts only OnCalendar lines whose runs are at least 60 seconds apart.

## How do you convert a cron expression to OnCalendar?

| Cron | OnCalendar | Runs |
| --- | --- | --- |
| `*/15 * * * *` | `*-*-* *:00/15:00` | Every 15 minutes |
| `0 * * * *` | `*-*-* *:00:00` or `hourly` | At the start of every hour |
| `0 2 * * *` | `*-*-* 02:00:00` | Every day at 02:00 |
| `0 9 * * 1-5` | `Mon..Fri *-*-* 09:00:00` | At 09:00 on weekdays |
| `0 0 1,15 * *` | `*-*-01,15 00:00:00` | At midnight on the 1st and 15th |
| `30 2 * * 0` | `Sun *-*-* 02:30:00` | At 02:30 every Sunday |

These are the forms the [cron generator and dialect converter](https://cronmissed.com/tools/cron-generator.md) writes. Paste any five-field line into it to get the OnCalendar form and a note about anything that does not translate.

## Which shortcuts does OnCalendar accept?

| Shortcut | Same as |
| --- | --- |
| `minutely` | `*-*-* *:*:00` |
| `hourly` | `*-*-* *:00:00` |
| `daily` | `*-*-* 00:00:00` |
| `weekly` | `Mon *-*-* 00:00:00` |
| `monthly` | `*-*-01 00:00:00` |
| `quarterly` | `*-01,04,07,10-01 00:00:00` |
| `semiannually` | `*-01,07-01 00:00:00` |
| `yearly` | `*-01-01 00:00:00` |

`weekly` is Monday, while cron's `@weekly` is Sunday, so a straight swap changes the day.

## How do the weekday and the date combine?

Differently from cron. In a crontab line with both day fields set, a match on either one runs the job. In OnCalendar the weekday is a filter on top of the date, so both must match: `Mon *-*-01..07 03:00:00` runs only on a Monday that falls in the first seven days, which is the first Monday of the month. Cron cannot say that in one line; see the [cron syntax cheat sheet](https://cronmissed.com/learn/cron-syntax-cheat-sheet.md) for its rule.

A tilde counts days from the end of the month. `*-*~1` is the last day of every month, and `Mon *-05~07/1` is the last Monday in May, a schedule that no single cron line can express.

## How do you test an expression before you use it?

```shell
systemd-analyze calendar "Mon..Fri *-*-* 09:00:00"
systemd-analyze calendar --iterations=5 "*-*-01,15 00:00:00"
```

The first command prints the expression in its normalized form and the next time it fires. `--iterations` prints several runs, which is the quickest way to check a schedule. You can also see the next runs on any cron line in the [next run calculator](https://cronmissed.com/tools/next-run-calculator.md).

## What else belongs in the timer?

- `Persistent=true` runs a job that was missed while the machine was off, once, at the next start. Cron has no equivalent.
- `RandomizedDelaySec=` spreads start times over a window, which keeps a fleet from all starting at once.
- `AccuracySec=` allows systemd to delay a run to save wakeups. It defaults to one minute.
- A trailing time zone, such as `daily UTC`, fixes the zone. Without it the expression follows the machine's time zone; see [cron time zones and daylight saving time](https://cronmissed.com/learn/cron-time-zones-and-dst.md).

To watch a timer, ping from the service it starts, as in the [systemd timers guide](https://cronmissed.com/guides/systemd-timers.md), and read [cron vs systemd timers](https://cronmissed.com/learn/cron-vs-systemd-timers.md) to choose between the two.

## Questions

### How do I run a systemd timer every 5 minutes?

Use `OnCalendar=*:0/5`. It fires at minutes 0, 5, 10 and so on of every hour. For a fixed gap after the last run rather than a clock time, use `OnUnitActiveSec=5min` instead.

### What does OnCalendar=daily mean?

The same as `*-*-* 00:00:00`: every day at midnight in the machine's time zone. Add a time, such as `*-*-* 02:00:00`, to move it.

### Can systemd run something every 30 seconds?

systemd accepts a seconds part, such as `*:*:0/30`. A CronMissed check cannot be that frequent: the shortest interval it accepts is one minute.

### Does OnCalendar run a job that was missed while the machine was off?

Only with `Persistent=true` in the timer. Without it, the run is skipped, as it is in cron.

## Sources

- [systemd.time(7) manual page](https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html), read 26 November 2026

## Related pages

- [Cron vs systemd timers](https://cronmissed.com/learn/cron-vs-systemd-timers.md)
- [systemd timers](https://cronmissed.com/guides/systemd-timers.md)
- [/tools/cron-generator](https://cronmissed.com/tools/cron-generator.md)
- [Cron syntax cheat sheet](https://cronmissed.com/learn/cron-syntax-cheat-sheet.md)
- [Cron time zones and daylight saving](https://cronmissed.com/learn/cron-time-zones-and-dst.md)

## Related

- [Cron monitoring explained: concepts and fixes](https://cronmissed.com/learn.md)
- [Cron vs systemd timers: which to use](https://cronmissed.com/learn/cron-vs-systemd-timers.md)
- [Monitor systemd timers with a ping](https://cronmissed.com/guides/systemd-timers.md)
- [Crontab generator and cron dialect converter](https://cronmissed.com/tools/cron-generator.md)
- [Cron syntax cheat sheet: fields and examples](https://cronmissed.com/learn/cron-syntax-cheat-sheet.md)
- [Cron time zones and daylight saving time](https://cronmissed.com/learn/cron-time-zones-and-dst.md)
