How to write a cron expression
Cron runs a command on a schedule written as five fields separated by spaces: minute, hour, day of month, month, day of week. Each field is a number, * for “every”, or a combination of the operators below. Type into the fields above, or start from a preset, and the tool explains the schedule and lists when it will next run.
| Syntax | Meaning | Example |
|---|---|---|
* | Every value | * * * * * — every minute |
a,b | A list | 0 9,17 * * * — 09:00 and 17:00 |
a-b | A range | 0 9 * * 1-5 — weekdays at 09:00 |
*/n | Every n-th value | */15 * * * * — every 15 minutes |
Using the expression
- Linux crontab: run
crontab -eand add0 9 * * 1-5 /path/to/script.sh. - Laravel:
$schedule->command('report:send')->cron('0 9 * * 1-5');, with a single system cron entry runningphp artisan schedule:runevery minute. - GitHub Actions:
on: schedule: - cron: '0 9 * * 1-5'— always in UTC.
Frequently asked questions
What do the five cron fields mean?
In order: minute (0–59), hour (0–23), day of month (1–31), month (1–12) and day of week (0–6, where 0 is Sunday; 7 is also accepted as Sunday). * means “every”.
What happens if I set both day of month and day of week?
Standard cron runs the job when either matches, not both. 0 9 1 * 1 runs at 09:00 on the 1st of every month and every Monday. The next-run preview above follows the same rule.
Which timezone does cron use?
The server's system timezone, unless your scheduler says otherwise (for example CRON_TZ, or a timezone set in Laravel, Kubernetes CronJobs or GitHub Actions — GitHub Actions always uses UTC). The preview uses your browser's timezone, so adjust if your server runs in UTC.
How do I run a job every 5 minutes?
Use a step in the minute field: */5 * * * *. Steps also work on ranges, such as 0-30/10 for minutes 0, 10, 20 and 30.
Built and maintained by Pradeep Bhandari, Senior Engineering Manager & Full-Stack Architect. Last reviewed .