Cron Expression Syntax Guide: Linux Crontab, Kubernetes CronJobs & Next-Run Examples
Master 5-field cron syntax, special characters (*, /, -, ,), daylight saving pitfalls, and production schedules for Linux crontab, GitHub Actions, and Kubernetes CronJobs.
Recommended Free Tool
Try Toolstack's Cron Expression Generator
Free, instantaneous, and processes 100% locally in your browser.
Cron expressions are the universal scheduling language of DevOps, backend engineering, and cloud automation. Whether you are configuring a nightly PostgreSQL backup on an Ubuntu server, running an invoice reconciliation job in a **Kubernetes CronJob**, or triggering automated dependency checks in **GitHub Actions**, a single misplaced asterisk can turn a once-a-day job into a costly incident that fires 60 times in an hour.
This guide breaks down standard 5-field cron syntax, special operators, real-world production recipes, and subtle edge cases like Daylight Saving Time (DST) drift.
The 5-Field Standard Cron Anatomy
Every POSIX/Vixie cron expression consists of five space-separated fields:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of the week (0 - 6, Sunday = 0 or 7)
│ │ │ │ │
* * * * *
Essential Cron Operators Explained
- **Wildcard (`*`)**: Matches every valid value in that field. For example, `*` in the hour field means every hour from 00 to 23.
- **Step Values (`*/n`)**: Fires at fixed intervals. `*/15 * * * *` runs at minutes 00, 15, 30, and 45 of every hour.
- **Ranges (`a-b`)**: Matches an inclusive range. `0 9-17 * * 1-5` runs on the hour from 9:00 AM through 5:00 PM, Monday to Friday.
- **Lists (`a,b,c`)**: Specifies discrete values. `0 8,14,20 * * *` executes at 08:00, 14:00, and 20:00 daily.
Production-Ready Cron Schedule Recipes
- **Every 5 minutes (Health Checks & Metric Scrapers)**: `*/5 * * * *`
- **Every weekday at 09:00 UTC (Daily Standup Digest)**: `0 9 * * 1-5`
- **Daily at 02:30 UTC (Database Backup)**: `30 2 * * *`
- **1st of every month at 00:00 UTC (Monthly Billing Rollup)**: `0 0 1 * *`
- **Every Sunday at 03:00 UTC (Cache Vacuum & Cleanup)**: `0 3 * * 0`
The Classic Crontab Traps That Break Production
1. **Forgetting the Minute Field (`* 2 * * *`)**: Many engineers accidentally write `* 2 * * *` intending "run once at 2:00 AM." Because the minute field is `*`, the job actually runs **every minute from 02:00 through 02:59**—60 consecutive executions! Always specify `0 2 * * *`.
2. **Day-of-Month + Day-of-Week OR Behavior**: Writing `0 9 13 * 5` does NOT mean "only Friday the 13th." Standard cron evaluates Day-of-Month and Day-of-Week with a logical OR, so it triggers on the 13th of every month AND on every Friday.
3. **Daylight Saving Time (DST) Anomalies**: Jobs scheduled at `02:30` local time vanish completely when clocks spring forward to `03:00` and execute twice when clocks fall back. Always standardize server and Kubernetes `spec.timeZone` schedules on **UTC**, and verify human timestamps with our [Unix Timestamp Converter](/en/unix-timestamp-converter).
Test Next-Run Timestamps Before Deploying
Before pushing a new Kubernetes manifest or `crontab -e` edit, validate your expression and inspect its next 10 exact UTC and local execution timestamps using our free [Cron Expression Generator & Tester](/en/cron-expression-generator). If your workflow also builds Kubernetes manifests, pair it with our [YAML to JSON Converter](/en/yaml-to-json-converter) and [JSON Schema Validator](/en/json-schema-validator).
Frequently Asked Questions
Quick answers to common questions covered in this guide.
More Guides in JSON & APIs
What is JSON? Complete RFC 8259 Standard Guide
Top 5 Common JSON Syntax Errors and How to Fix Them
JSON Formatting vs Minification: When to Use Each
Why Trailing Commas Break JSON (and How to Auto-Fix)
How to Parse Large JSON in JavaScript Without Crashing
JSON vs YAML vs XML: Data Serialization Formats Compared
Explore More Free Tools on Toolstack
Client-side developer utilities, image converters, calculators, and educational engineering guides.
JWT Decoder
Safely inspect JSON Web Token header, payload claims, and expiration client-side.
Case Converter
Transform text across UPPERCASE, lowercase, camelCase, snake_case, and Title Case.
AI Background Remover
Remove image backgrounds automatically and download clean transparent PNGs.
Invoice PDF Generator
Create and download professional, print-ready vector PDF invoices with itemized taxes.
Favicon & App Icon Generator
Generate multi-size browser favicons, Apple Touch Icons, and download binary favicon.ico.
Global Salary Calculator
Calculate net take-home salary, income taxes, social security, and deductions across 34 countries.
Related Engineering Guides & Tutorials
All GuidesBase64 & Encoding · 6 min read
What is Base64 Encoding? Complete Guide & Visual Explanation
Learn what Base64 encoding is, why systems convert binary bytes into 64 ASCII characters, and how it powers web protocols.
Base64 & Encoding · 5 min read
How Base64 Decoding Works: Behind the 6-Bit Math
Step-by-step mathematical breakdown of how Base64 decoders convert four 6-bit characters back into three original 8-bit bytes.
Base64 & Encoding · 5 min read
Base64 vs Base64URL: RFC 4648 Standards Explained
Discover why standard Base64 breaks in URLs and query strings, and how the RFC 4648 Base64URL standard fixes it with hyphens and underscores.