Skip to content
OpsAtlas

Cron expression parser

Linux

Paste a five-field cron expression to see what it means, when it runs next, and whether it hides a surprise like day-of-month OR day-of-week matching.

Runs entirely in your browser — your input is never uploaded.

Five fields: minute hour day-of-month month day-of-week. Macros like @daily work too.

Examples:
Enter an expression or pick an example to see what it means and when it runs.

How to read a cron expression

A crontab line has five time fields, then the command:

┌───────────── minute        0–59
│ ┌─────────── hour          0–23
│ │ ┌───────── day of month  1–31
│ │ │ ┌─────── month         1–12 or JAN–DEC
│ │ │ │ ┌───── day of week   0–7 or SUN–SAT (0 and 7 are Sunday)
│ │ │ │ │
30 9 * * 1-5  /usr/local/bin/backup.sh

Each field accepts:

SyntaxMeaningExample
*every value* in hours = every hour
a,ba list0,30 = minute 0 and 30
a-ba range1-5 = Monday to Friday
*/nevery n-th value from the start*/15 = 0, 15, 30, 45
a-b/nevery n-th value within a range9-17/2 = 9, 11, 13, 15, 17

Macros replace the whole schedule: @hourly, @daily (@midnight), @weekly, @monthly and @yearly (@annually).

Examples

ExpressionRuns
*/5 * * * *every 5 minutes
0 */2 * * *every 2 hours, on the hour
30 9 * * 1-509:30 on weekdays
0 0 1 * *midnight on the 1st of every month
0 3 * * 003:00 every Sunday
0 0 1 1 *midnight on 1 January

Where cron syntax shows up

  • Linux crontab: crontab -e for your user, or files in /etc/cron.d/, which also take a user name before the command. Times follow the server’s time zone.
  • Kubernetes CronJob: spec.schedule uses the same five fields. Set spec.timeZone: "Europe/Berlin" to avoid surprises when the controller runs in UTC.
  • GitHub Actions: on.schedule[].cron is always UTC. Runs can be delayed during busy periods, and the shortest interval is 5 minutes.

Common traps

  • Day-of-month OR day-of-week. If both are set, either one matching is enough. The tool warns when this happens.
  • Uneven steps. */7 restarts at minute 0 every hour, giving a short final gap. Use steps that divide 60 or 24.
  • Days that don’t exist. 0 0 31 * * silently skips the five months that have fewer than 31 days, and 0 0 30 2 * never runs.
  • % in commands. In a crontab line, an unescaped % ends the command and starts standard input. Write date +\%F, not date +%F.
  • Missing environment. Cron runs with a minimal PATH and no shell profile. Use absolute paths and redirect output (>> /var/log/job.log 2>&1) so failures are visible.

Frequently asked questions

Why does "0 0 1 * 1" run every Monday and not just on Mondays that are the 1st?
When both day-of-month and day-of-week are restricted, crontab(5) runs the job when either one matches. Keep one of the two fields as * and add a check in the script, e.g. [ "$(date +%d)" -le 07 ] for "first Monday".
Which time zone does cron use?
The system time zone of the machine running the cron daemon (or CRON_TZ/TZ where supported). Kubernetes CronJobs default to the controller manager time zone (usually UTC) unless spec.timeZone is set, and GitHub Actions schedules are always UTC.
How do I run a job on the last day of the month?
Standard cron has no "L" syntax. Schedule it for days 28–31 and exit early unless tomorrow is the 1st: [ "$(date -d tomorrow +%d)" = 01 ] && run-job.
Why does */7 in the minute field run at :56 and then :00?
A step counts from the start of the range (0) and restarts every hour, so */7 means 0, 7, …, 56, then 0 again — a 4-minute gap. Only steps that divide 60 (or 24 for hours) are evenly spaced.
Does this support seconds or Quartz syntax like ? and L?
No. It follows the standard five-field crontab format used by Linux cron, Kubernetes CronJobs and GitHub Actions. Quartz/Spring expressions with a seconds field are detected and reported.
  • GitHub Actions matrix expander

    Preview every job a GitHub Actions strategy.matrix creates, with include and exclude applied exactly as GitHub does, before you push.

    CI/CD
  • docker run to Docker Compose converter

    Convert docker run commands into a clean compose.yaml: ports, volumes, env, networks, healthchecks and limits. Runs in your browser.

    Docker

Last updated · More Linux tools