Cron Expression Examples — 25 Ready-to-Use Cron Schedules
Cron expressions are compact schedule strings used in Linux crontab, GitHub Actions, AWS EventBridge, Kubernetes CronJobs, and dozens of other platforms. This guide covers the five-field syntax, 25 practical examples, the special characters you need to know, and key differences between platforms.
Cron Syntax: The 5 Fields
A standard cron expression has five space-separated fields:
| Field | Position | Values |
|---|---|---|
| Minute | 1st | 0–59 |
| Hour | 2nd | 0–23 |
| Day of month | 3rd | 1–31 |
| Month | 4th | 1–12 or JAN–DEC |
| Day of week | 5th | 0–7 (0 and 7 both = Sunday), or SUN–SAT |
25 Cron Expression Examples
| Expression | Meaning |
|---|---|
| * * * * * | Every minute |
| */5 * * * * | Every 5 minutes |
| */15 * * * * | Every 15 minutes |
| */30 * * * * | Every 30 minutes |
| 0 * * * * | Every hour (at :00) |
| 0 */2 * * * | Every 2 hours |
| 0 */6 * * * | Every 6 hours |
| 0 0 * * * | Daily at midnight |
| 0 9 * * * | Daily at 9:00 AM |
| 0 9,17 * * * | Daily at 9 AM and 5 PM |
| 0 9-17 * * * | Every hour from 9 AM to 5 PM |
| 0 9 * * 1-5 | Weekdays at 9:00 AM |
| 0 9 * * 1 | Every Monday at 9:00 AM |
| 0 9 * * 6,0 | Weekends at 9:00 AM |
| 0 0 * * 0 | Every Sunday at midnight |
| 0 0 1 * * | 1st of every month at midnight |
| 0 0 15 * * | 15th of every month at midnight |
| 0 0 1,15 * * | 1st and 15th of every month |
| 0 0 L * * | Last day of every month (some platforms) |
| 0 0 1 */3 * | 1st of every quarter (Jan, Apr, Jul, Oct) |
| 0 0 1 1 * | January 1st at midnight (yearly) |
| 0 2 * * * | Daily at 2:00 AM (good for DB backups) |
| 30 23 * * * | Daily at 11:30 PM |
| 0 8 * * 1 | Monday morning standup reminder |
| */10 9-17 * * 1-5 | Every 10 min during business hours |
Special Characters
| Character | Meaning | Example |
|---|---|---|
| * | Any / all values | * in hour = every hour |
| / | Step / every N | */5 in minute = every 5 min |
| - | Range | 9-17 in hour = 9 AM to 5 PM |
| , | List | 1,15 in day = 1st and 15th |
| L | Last (some platforms) | L in day = last day of month |
| ? | No specific value (some platforms) | Used in day-of-month or day-of-week when the other is set |
| # | Nth weekday (some platforms) | 2#1 = first Monday of the month |
Platform Differences
Cron expressions are not fully portable across platforms. Here are the key differences to watch for:
Linux crontab
Standard 5-field format. Supports named macros like @hourly, @daily, @weekly, @monthly, @yearly, and @reboot. No support for seconds or L/# specifiers.
GitHub Actions
Uses standard 5-field format in YAML. Note that GitHub Actions uses UTC and has a minimum resolution of 5 minutes (scheduled workflows run on shared runners with delay).
AWS EventBridge (CloudWatch Events)
Uses a 6-field format: minute hour day month weekday year. Supports L, W, and #. Requires ? instead of * in either day-of-month or day-of-week.
Kubernetes CronJob
Uses standard 5-field Linux cron syntax. The schedule runs in UTC by default (configurable per cluster timezone in Kubernetes 1.24+).
Related Tools
Related Guides
FAQ
What does * * * * * mean in cron?
Five asterisks (* * * * *) means 'every minute of every hour of every day of every month on every day of the week' — i.e., the job runs once per minute, continuously.
How do I run a cron job every 5 minutes?
Use */5 in the minute field: */5 * * * *. The / operator means 'every N units'. So */5 means every 5 minutes, */15 means every 15 minutes, and so on.
Does cron support seconds?
Standard Unix/Linux crontab does not support seconds — the finest resolution is 1 minute. However, some platforms add a 6th field for seconds: AWS EventBridge, Quartz Scheduler (Java), and Spring's @Scheduled annotation all support a seconds field.
What is the difference between crontab and a cron expression?
A crontab is the file (or service) that stores and runs cron jobs on a Linux system. A cron expression is the schedule string itself (e.g., 0 9 * * 1). Cron expressions are also used in cloud platforms, job schedulers, and frameworks — independently of the crontab file.
How do I test a cron expression without waiting?
Use DevKit's Cron Parser — paste any cron expression and instantly see the next 10 execution times. This lets you verify complex schedules without deploying.