Cron Expressions Explained (with Examples)
Cron is the classic way to run a task on a schedule — backups every night, reports every Monday, a clean-up every 15 minutes. The same five-field syntax is used by Linux crontab, Kubernetes CronJobs, GitHub Actions and many hosting panels.
This guide explains the syntax, gives examples you can copy, and covers the mistakes that most often make a job run at the wrong time.
The five fields
A cron expression has five fields separated by spaces: minute (0–59), hour (0–23), day of month (1–31), month (1–12) and day of week (0–6, where 0 is Sunday).
For example, 30 9 * * 1 means minute 30, hour 9, any day of the month, any month, on Monday — every Monday at 09:30.
Special characters
An asterisk * means "every value". A comma makes a list: 0,30 in the minute field means at minute 0 and 30. A dash makes a range: 1-5 in the day-of-week field means Monday to Friday. A slash makes a step: */15 in the minute field means every 15 minutes.
Many systems also accept shortcuts: @hourly, @daily (midnight), @weekly, @monthly and @yearly.
Examples you can copy
*/5 * * * * — every 5 minutes. 0 * * * * — at the start of every hour. 0 2 * * * — every day at 02:00. 30 9 * * 1-5 — weekdays at 09:30. 0 0 1 * * — at midnight on the first day of every month. 0 18 * * 5 — every Friday at 18:00.
Paste any of them into Cron Parser to see a plain-English description and the next five run times before you use it.
The time-zone trap
Cron runs in the time zone of the system that executes it. Most cloud servers, Docker containers and GitHub Actions use UTC. India Standard Time is UTC + 5:30, so a job written as 0 9 * * * on a UTC server runs at 2:30 PM in India.
To run at 9:00 AM IST on a UTC server, subtract 5 hours 30 minutes: 30 3 * * *. Kubernetes CronJobs can set an explicit time zone with the timeZone field, which avoids the conversion.
Day of month and day of week together
When both day fields are restricted — for example 0 9 1 * 1 — classic cron runs the job when either matches: on the 1st of the month and also on every Monday. This surprises many people. To run "on the first Monday", use a day-of-week schedule and check the date inside the script.
Check a schedule step by step
Before deploying a schedule:
- Write the expression and paste it into Cron Parser.
- Read the description and the next run times, which are shown in your local time zone.
- Convert the hour to the server's time zone (often UTC) if it differs from yours.
- Log the start time inside the job so you can confirm it runs when expected.
Frequently asked questions
What does */15 mean?
Every 15 minutes: at minutes 0, 15, 30 and 45.
Is Sunday 0 or 7?
In standard cron Sunday is 0, and many implementations also accept 7.
Can cron run every 30 seconds?
Standard cron has a one-minute resolution. For shorter intervals, run a loop inside the job or use a scheduler that supports seconds.
Why did my job run at the wrong hour?
Almost always a time-zone difference — the server is probably using UTC.