Skip to content
dz / cron-every-5-minutes

Cron every 5 minutes

The expression is */5 * * * * – it runs at minute 0, 5, 10 … 55 of every hour.

/cron

minute · hour · day of month · month · day of week

Build

Next runs

# UTC Your time In

When both day of month and day of week are set, the job runs when either matches – the standard behaviour of crontab and most schedulers.

How */5 works

The first of the five fields is the minute. */5 means "every minute from 0 to 59 that is divisible by 5", so the job runs at :00, :05, :10 … :55 – aligned to the clock, not to the moment you saved the crontab. The other four * mean every hour, day, month and weekday.

Do not confuse it with 5 * * * *, which runs once an hour, at five past.

Variants

*/10 * * * *       every 10 minutes
*/15 * * * *       every 15 minutes (:00, :15, :30, :45)
2-59/5 * * * *     every 5 minutes, offset by 2 (:02, :07 …)
*/5 9-17 * * 1-5   every 5 minutes during office hours, Mon–Fri

An offset like 2-59/5 spreads load when many jobs would otherwise start at the same second.

Questions

How do I write the crontab line?

Expression, then the command: */5 * * * * /usr/local/bin/backup.sh. Edit it with crontab -e; use absolute paths, because cron runs with a minimal environment.

Can cron run every 5 seconds?

Classic Unix cron cannot go below one minute. Schedulers with a seconds field (Quartz, Spring, node-cron) accept */5 * * * * * – type six fields above and the explainer handles them.

Does it work in GitHub Actions?

Yes, but five minutes is the shortest interval GitHub allows, schedules run in UTC, and runs can be delayed when GitHub is busy.

▸ About this tool

About the Cron Expression Generator & Explainer

Introduction

Cron is the scheduler built into Unix and Linux, and its five-field syntax has become the common language for recurring jobs everywhere: crontab files, Kubernetes CronJobs, GitHub Actions, GitLab CI, AWS EventBridge, Jenkins, Spring and Quartz, Laravel, Node and Python task runners. The syntax is compact but easy to misread – is 0 9 * * 1-5 nine o'clock or every ninth minute? This tool answers that in plain English, shows exactly when the job will run next, and lets you build an expression by clicking instead of memorising the rules.

How to use it

  1. Explain: paste an expression – the sentence below it and the next run times update as you type. Each field gets its own card showing what it means; invalid values are reported immediately.

  2. Build: start from one of the common schedules, then click a field card (minute, hour, day, month, weekday) and choose every, every N, a range or specific values from a grid. The expression is written for you.

  3. Check the time zone: cron runs in the server's time zone – usually UTC. Pick the server's zone and the table shows each run both there and in your own local time, including daylight-saving changes.

  4. Copy the expression, or copy a link that opens this exact schedule for a colleague.

Short links: develzone.org/cron and /crontab. Pasting an expression into the search box on the home page brings you here too.

The cron syntax

┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12 or JAN–DEC)
│ │ │ │ ┌───── day of week (0–6 or SUN–SAT, 7 = Sunday)
│ │ │ │ │
* * * * *
  • * – every value · 5 – exactly 5 · 1,15 – a list · 9-17 – a range · */15 – every 15th value · 10-50/10 – every 10th value within a range.

  • L – last day of the month, 15W – the weekday nearest the 15th, 5L – the last Friday, 1#2 – the second Monday of the month (supported by Quartz-style schedulers and this tool).

  • Nicknames: @hourly, @daily, @weekly, @monthly, @yearly.

  • With the Seconds field option a sixth field is added at the front, as used by Quartz, Spring, Hangfire and node-cron.

Classic pitfalls

  • Day of month and day of week: 0 0 13 * 5 does not mean "Friday the 13th" – it runs on every 13th and on every Friday. When both fields are restricted, cron joins them with OR.

  • Time zones and daylight saving: a job at 30 2 * * * can be skipped or run twice in zones that change clocks at 02:00. Servers in UTC avoid this.

  • * 9 * * * runs every minute from 09:00 to 09:59 – sixty times. For once a day you need 0 9 * * *.

  • Steps restart every hour or day: */45 in the minute field fires at :00 and :45, so the gap is 45 then 15 minutes.

  • Days that do not exist never match: 0 0 31 2 * (31 February) never runs.

Privacy

Everything – the explanation, validation and the run-time calculation – happens in your browser. Expressions are not sent to or stored on a server.

A bit of history

The first cron appeared in Version 7 Unix in 1979; the name comes from chronos, Greek for time. The format used today was written by Paul Vixie in 1987 ("Vixie cron") and is still the default on most Linux distributions. Need to convert a run time to a Unix timestamp? Use the Unix timestamp converter.

❯ Esc
↑ ↓ select ↵ open Shift ↵ new line