Developer

Cron Every 5 Minutes — and the Rest of Cron Syntax, Explained

ToolOrbit Engineering 2 min readUpdated
Cron Every 5 Minutes — and the Rest of Cron Syntax, Explained

You need a job to run every 5 minutes. The answer is */5 * * * * — but if that line looks like line noise, this guide will make cron expressions readable in about five minutes (fittingly).

The five fields

A standard cron expression is five fields separated by spaces, read left to right:

┌───────── minute        (0–59)
│ ┌─────── hour          (0–23)
│ │ ┌───── day of month  (1–31)
│ │ │ ┌─── month         (1–12)
│ │ │ │ ┌─ day of week   (0–7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *

An asterisk means "every". Beyond plain numbers, three operators cover almost everything: a range (1-5), a list (1,15,30), and a step (*/5, meaning every 5th value).

The schedules everyone needs

  • */5 * * * * — every 5 minutes.
  • 0 * * * * — every hour, on the hour.
  • 0 0 * * * — every day at midnight.
  • 0 9 * * 1-5 — weekdays at 09:00.
  • 0 0 1 * * — first day of every month at midnight.
  • 30 2 * * 0 — Sundays at 02:30.

The gotcha: day-of-month OR day-of-week

Here is the rule that surprises almost everyone. When you restrict both the day-of-month field and the day-of-week field, standard cron runs the job when either one matches — not both. So 0 0 13 * 5 does not mean "Friday the 13th"; it fires on every 13th and on every Friday. If you need the intersection, check one condition inside your script instead.

Also remember: cron runs in the server's timezone, which is very often UTC. A job scheduled for 9:00 may fire at 2 PM your time. Check with the timezone your scheduler actually uses.

Verify before you deploy

The cheapest cron bug to fix is the one that never ships. Paste your expression into our Cron Expression Generator to see it decoded into plain English along with the next three times it would actually fire — in your local timezone, so mismatches jump out immediately.

Picking the right short interval

Short cadences and their costs
ExpressionRuns per hourFreshnessTypical fit
* * * * *60Seconds apartOnly when required; usually too heavy
*/5 * * * *12Up to 5 minMonitoring, queues, market data
*/10 * * * *6Up to 10 minSyncs, ETL, cache refreshes
*/15 * * * *4Up to 15 minOpportunistic jobs
*/30 * * * *2Up to 30 minReports, digests

Jobs that genuinely want every 5 minutes

  • Availability checks where a 5-minute blind spot is acceptable.
  • Consumers of a message queue maintained by polling.
  • Metrics collectors pulling counters into a dashboard.
  • Cache warmers refreshing frequently-requested endpoints.
If freshness can tolerate 10 minutes, */10 halves the load for the same outcome — the every-10-minutes guide walks through when that trade is right.

Tools mentioned

More reading

View all guides
What Is Base64? How Encoding Works and Common Mistakes
Developer

What Is Base64? How Encoding Works and Common Mistakes

What Base64 encoding actually does, where it is used, and the mistakes that cause broken or oversized output.

2 min readUpdated
encodeURI vs encodeURIComponent: Which One to Use
Developer

encodeURI vs encodeURIComponent: Which One to Use

How percent-encoding works, the difference between encoding a whole URL and a single component, and the mistakes that break links.

2 min readUpdated
What Is a UUID? Version 4 vs Version 7 Explained
Developer

What Is a UUID? Version 4 vs Version 7 Explained

What a UUID looks like, why version 4 is the safe default, when version 7 is better, and best practices for IDs.

2 min readUpdated
How SHA-256 and SHA-512 Hashes Work: Hashing vs Encryption
Developer

How SHA-256 and SHA-512 Hashes Work: Hashing vs Encryption

What a hash function does, how to choose between SHA-256 and SHA-512, and why hashing is not encryption.

2 min readUpdated
What Is a JWT? Header, Payload and Signature Explained
Developer

What Is a JWT? Header, Payload and Signature Explained

A JSON Web Token has three parts. Learn what the header, payload and signature contain, how to read the claims, and why decoding is not verifying.

2 min readUpdated
What Is HTML Encoding? Entities & Escaping Explained
Developer

What Is HTML Encoding? Entities & Escaping Explained

Learn how HTML encoding works, why escaping prevents XSS and layout breaks, and how to encode and decode named, decimal, and hex entities.

2 min readUpdated
Unix Time Explained: Seconds, Milliseconds and Time Zones
Developer

Unix Time Explained: Seconds, Milliseconds and Time Zones

What a Unix timestamp is, how to tell seconds from milliseconds, how time zones come into it, and the values worth recognising.

2 min readUpdated
Binary, Octal, Decimal and Hex: How Number Bases Work
Developer

Binary, Octal, Decimal and Hex: How Number Bases Work

How positional number bases work, why very large values need exact arithmetic, and the hex and binary values you meet every day.

2 min readUpdated