Blog
5 min read

Cron Expressions Explained: What "*/5 * * * *" Means (With Examples)

A beginner's guide to cron syntax: the five fields, special characters, a cheat sheet of common schedules (every 5 minutes, daily at 9am, weekdays), the time zone and overlap gotchas, and where cron expressions show up — crontab, GitHub Actions, and app schedulers.

0 9 * * 1-5 looks like a typo, but it means "every weekday at 9:00". It's a cron expression — a compact way of describing a schedule, used everywhere from Linux servers to GitHub Actions to app frameworks. Once you know the five fields, you can read and write them confidently.

The five fields

┌───────────── minute        (0–59)
│ ┌─────────── hour          (0–23)
│ │ ┌───────── day of month  (1–31)
│ │ │ ┌─────── month         (1–12)
│ │ │ │ ┌───── day of week   (0–6, Sunday = 0; 7 is also Sunday in many systems)
│ │ │ │ │
* * * * *

The job runs whenever all the fields match the current time (with one exception, below).

Special characters

Symbol Meaning Example
* every value * in hour = every hour
, a list 1,15 in day-of-month = the 1st and 15th
- a range 1-5 in day-of-week = Monday to Friday
/ a step */15 in minute = every 15 minutes

Cheat sheet

Expression Runs
* * * * * every minute
*/5 * * * * every 5 minutes
0 * * * * every hour, on the hour
30 * * * * every hour at half past
0 9 * * * every day at 09:00
0 9 * * 1-5 weekdays at 09:00
0 0 * * 0 every Sunday at midnight
0 3 1 * * the 1st of every month at 03:00
0 */6 * * * every 6 hours (00:00, 06:00, 12:00, 18:00)
15 2 * * * daily at 02:15

Many systems also accept shortcuts: @hourly, @daily (midnight), @weekly, @monthly, and @reboot (on system start).

Reading one, step by step

30 2 * * 1:

  • minute 30, hour 2 → at 02:30,
  • any day of month, any month,
  • day of week 1 → Monday.

Every Monday at 02:30.

The gotchas

1. Time zones

Cron runs in the time zone of whatever is running it. On most servers and almost all cloud schedulers — including GitHub Actions — that's UTC. 0 9 * * * on a UTC server runs at 9:00 UTC, which is 10:00 or 11:00 in Central Europe depending on daylight saving, and the early hours in the US. Some schedulers let you set a time zone; otherwise, convert. (Dates and time zones in apps.)

Daylight saving also means jobs scheduled in local time between about 1:00 and 3:00 can run twice or be skipped on change-over nights. Schedule important jobs outside that window, or use UTC.

2. Day of month OR day of week

If you set both day-of-month and day-of-week (neither is *), classic cron runs the job when either matches. 0 9 1 * 1 means "9:00 on the 1st of the month and every Monday", not "Mondays that fall on the 1st".

3. Overlapping runs

If a job scheduled every 5 minutes sometimes takes 7, two copies run at once — double emails, double charges, corrupted data. Make jobs idempotent (safe to run twice), or use a lock so a new run skips if the previous one is still going. (Postgres advisory locks are one way.)

4. Silent failures

A cron job that fails at 3am tells nobody. Log its output, and use a "heartbeat" monitor that alerts you when an expected job doesn't check in. (How to know when your app is down.)

5. Minimum intervals

Cloud schedulers often have limits. GitHub Actions scheduled workflows run at most every 5 minutes, can be delayed at busy times, and in public repositories are disabled after 60 days without repository activity.

Where you'll write cron expressions

  • Linux crontab: crontab -e opens your schedule; each line is an expression followed by a command:

    0 3 * * * /home/app/backup.sh >> /home/app/backup.log 2>&1
    
  • GitHub Actions:

    on:
      schedule:
        - cron: "0 9 * * 1-5"
    
  • App frameworks and job queues — many have built-in schedulers using the same syntax. (Your app needs background jobs.)

  • Hosting platforms offering scheduled functions.

Some systems add a sixth field for seconds at the front, or a year at the end — check the documentation if an expression has six or seven parts.

Test before trusting

Paste an expression into an online cron explainer to see it in plain English and list the next few run times. It takes ten seconds and catches most mistakes.

The summary

  • Five fields: minute, hour, day of month, month, day of week.
  • * every, , list, - range, / step.
  • Cron usually runs in UTC; watch daylight saving.
  • Make jobs safe to overlap or run twice, and monitor that they actually run.

EasySpawn servers stay on around the clock, so your scheduled jobs have a persistent place to run beside your app and database — not a sleeping laptop or a function with a time limit. See how it works or join the waitlist.

Related: Your App Needs Background Jobs · What Is YAML? · Postgres as a Job Queue · Backups for Beginners

Keep reading