Enter a standard 5-field cron to compute its next few run times — handy for scheduling jobs and debugging cron.
A standard cron expression has five space-separated fields, read left to right:
| Field | Range | Meaning |
|---|---|---|
| Minute | 0 – 59 | Which minute past the hour |
| Hour | 0 – 23 | 24-hour clock |
| Day of month | 1 – 31 | Which day of the month |
| Month | 1 – 12 | 1 = January |
| Day of week | 0 – 7 | 0 and 7 both mean Sunday |
* — every value in the field. * in minute means "every minute"., — a list. 1,15,30 means those three values.- — a range. 9-17 means 9 through 17 inclusive./ — a step. */5 in minutes means every 5 minutes; 10/15 means starting at 10, then every 15.| Expression | When it runs |
|---|---|
0 3 * * * | Every day at 03:00 |
*/15 * * * * | Every 15 minutes, all day |
0 9 * * 1-5 | Weekdays at 09:00 |
30 2 1 * * | 02:30 on the first of every month |
0 0 1 1 * | Midnight on 1 January, once a year |
When both day-of-month and day-of-week are restricted (neither is *), cron joins them with OR, not AND. So 0 0 13 * 5 fires on every Friday and the 13th of every month — not only on Friday the 13th. To get the intersection you have to check the date inside the job itself.
Many systems accept a sixth leading field for seconds, and Quartz-style schedulers use seven fields (seconds plus an optional year) along with keywords like ? and L for "last". Because dialects differ, always confirm which flavour the target system runs before pasting an expression into production.
Most real jobs are one of a handful of patterns, so it is worth having them memorised rather than re-derived each time:
| Expression | Runs |
|---|---|
*/5 * * * * | Every 5 minutes, around the clock |
0 * * * * | On the hour, every hour |
30 3 * * * | Daily at 03:30 |
0 9 * * 1-5 | Weekdays at 09:00 |
0 4 * * 0 | Sunday at 04:00 — quiet hours for maintenance |
0 0 1 * * | First of every month at midnight |
0 0 1 1 * | Once a year, 1 January |
Where the implementation supports them, macros express the same thing without the arithmetic:
@hourly = 0 * * * *
@daily = 0 0 * * *
@weekly = 0 0 * * 0
@monthly = 0 0 1 * *
@yearly = 0 0 1 1 *
@reboot — once, when the daemon starts
A cron expression carries no zone: it is interpreted in the daemon's local time. On a container or a minimal cloud image that is almost always UTC, so 0 9 * * * meant as "nine in the morning" fires at 17:00 Beijing time, or 02:00 in Los Angeles. The job runs perfectly and at the wrong moment — a failure that leaves no error to search for.
Either set TZ in the container environment so the daemon inherits the intended zone, or convert the target local time to UTC once and write the expression in UTC. Check which applies before trusting any schedule that looks suspiciously offset by a round number of hours.