Cron Expression Guide: Syntax, Examples and Common Mistakes

Cron is the classic way to run jobs on a schedule – backups every night, reports every Monday, cleanup every 15 minutes. A cron expression like 30 2 * * 1-5 packs a schedule into five fields. Once you know what each field means, you can read and write them in seconds.

Free tool
Build a cron expression
Pick a schedule or paste an expression to see it in plain English and the next run times. Works for crontab, GitHub Actions and Kubernetes. Free.
Open Cron Expression Generator →

The five fields

PositionFieldAllowed values
1Minute0–59
2Hour0–23
3Day of month1–31
4Month1–12 or JAN–DEC
5Day of week0–6 (0 = Sunday) or SUN–SAT

Special characters

  • * – every value (“every minute”, “every hour”)
  • , – a list: 1,15 = the 1st and 15th
  • - – a range: 1-5 = Monday to Friday
  • / – a step: */15 in the minute field = every 15 minutes

Examples

ExpressionRuns
* * * * *Every minute
*/5 * * * *Every 5 minutes
0 * * * *Every hour, on the hour
0 */6 * * *Every 6 hours
0 0 * * *Every day at midnight
30 2 * * *Every day at 02:30
0 9 * * 1-5Weekdays at 09:00
0 9 * * 1Every Monday at 09:00
0 0 * * 0Every Sunday at midnight
0 0 1 * *First day of every month
0 0 1 1 *Every year on 1 January
15 14 1,15 * *14:15 on the 1st and 15th
0 22 * * 1-5Weeknights at 22:00
0 8-18 * * 1-5Every hour from 08:00 to 18:00 on weekdays
0 0 * * 6,0Weekends at midnight

Time zones

  • Linux crontab: uses the server’s time zone.
  • GitHub Actions: schedules run in UTC, and very frequent schedules may be delayed at busy times. The shortest interval is every 5 minutes.
  • Kubernetes CronJob: uses the controller’s time zone unless you set the timeZone field.
  • Cloud schedulers: usually let you choose a time zone.

Always check which time zone your platform uses – it is the most common reason a job runs “at the wrong time”. Convert times with the Unix Timestamp Converter.

Common mistakes

  • Every minute by accident: * 9 * * * runs every minute from 09:00 to 09:59. You probably meant 0 9 * * *.
  • Day of month and day of week together: in standard cron, 0 0 13 * 5 runs on the 13th or on every Friday – not only on Friday the 13th.
  • Seconds field: some systems (Quartz, Spring) use six or seven fields with seconds first. Standard cron has five.
  • Overlapping runs: if a job takes longer than its interval, two copies may run at once. Use a lock.
  • Silent failures: log output and alert on errors.

FAQ

What does * * * * * mean in cron?

Run every minute.

How do I run a cron job every 5 minutes?

Use */5 * * * *.

What time zone does cron use?

The server’s time zone for crontab; UTC for GitHub Actions; check your platform’s documentation for others.

Can cron run every 30 seconds?

Standard cron’s smallest interval is one minute. Use a loop, a systemd timer or a scheduler that supports seconds.

How do I check what a cron expression means?

Paste it into the generator to see it in plain English and the next run times.

Free tool
Try the free Cron Expression Generator
No signup and nothing uploaded – it runs right in your browser. Browse all 74 free tools on our Free Tools page.
Open Cron Expression Generator →

Need a website or app for your business? Talk to Techpass Master – we design and build websites and apps for clients worldwide.

WhatsApp us📞 Call now