Cron Generator
Build a cron expression by picking minutes, hours, days, months and weekdays on five tabs, so you never have to recall which field is day-of-month and which is day-of-week. A plain-English reading appears under the expression, and you can check it before the line goes into a crontab.
1 Example Expressions
Common Patterns
2
3
4
5
6
7
8
// At 04:05 on Sunday
5 4 * * 0
// Every 15 minutes
*/15 * * * *
// At 22:00 on every day-of-week from Monday through Friday
0 22 * * 1-5 2 Pick the schedule, then read it back
The two day fields
Restrict one day field, not both. When day-of-month and day-of-week are both set, standard cron runs the job when either matches. For example, 0 0 13 * 5 fires on every 13th and on every Friday.
A sentence you can review
Read the sentence before you copy. "At 17:00 on Friday" makes a wrong field obvious in a way that 0 17 * * 5 does not. The Last day of the month option writes L, which Quartz and some schedulers accept but standard crontab rejects.
Workflow
Building a 5-field cron schedule visually
- 01 Open each of the five tabs (Minute, Hour, Day, Month, Weekday) and choose an option: every value, specific values, or on the Minute and Hour tabs an interval such as Every 15 minute(s).
- 02 When you pick a Specific option, click the values in the grid; you can select several. The Day tab also offers Last day of the month, which writes L (accepted by Quartz, not by standard crontab).
- 03 The expression at the top updates as you click, and the line under it explains the schedule in plain English, for example "At 09:00 on Monday through Friday".
- 04 Click the copy icon next to the expression and paste it into your crontab, Kubernetes CronJob or GitHub Actions workflow.
- 05 Click Reset to return to * * * * * (every minute).
Examples
How to schedule a cron job in crontab, Node.js and Python
crontab (Linux / macOS)
bash# Open your user's crontab in an editor
crontab -e
# ┌─ minute (0-59)
# │ ┌─ hour (0-23)
# │ │ ┌─ day of month (1-31)
# │ │ │ ┌─ month (1-12)
# │ │ │ │ ┌─ day of week (0-6, Sunday = 0)
# │ │ │ │ │
*/15 * * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
0 9 * * 1-5 /usr/local/bin/report.sh
30 2 1 * * /usr/local/bin/monthly.sh
# List and remove
crontab -l
crontab -r cron runs with a minimal PATH and no shell profile. Use absolute paths for commands and redirect output to a log, or you will never see the errors.
JavaScript (node-cron)
js// npm i node-cron
const cron = require("node-cron");
// Every weekday at 09:00 in the given time zone
cron.schedule("0 9 * * 1-5", () => {
console.log("Sending daily report", new Date().toISOString());
}, { timezone: "Europe/Amsterdam" });
// Validate an expression before saving it
console.log(cron.validate("*/15 * * * *")); // true
console.log(cron.validate("60 * * * *")); // false node-cron accepts an optional sixth field for seconds at the start. Standard crontab has no seconds field.
Python (croniter)
python# pip install croniter
from datetime import datetime
from croniter import croniter
expr = "0 9 * * 1-5"
if not croniter.is_valid(expr):
raise SystemExit("bad cron expression")
# Preview the next 3 run times from now
it = croniter(expr, datetime.now())
for _ in range(3):
print(it.get_next(datetime))
# For a scheduler in-process see APScheduler's CronTrigger.from_crontab(expr) Troubleshooting
Day-of-month vs weekday OR behavior and UTC traps
- crontab: bad minute / errors in crontab file, can't install
- A field is out of range, such as 60 in minutes or 24 in hours, or the line has fewer than five fields before the command. Check each field's range and use a single space or tab between fields.
- The job runs at the wrong time by a few hours
- cron uses the system time zone of the machine, usually UTC on servers and containers. Convert your local time to UTC, or set CRON_TZ=Europe/Amsterdam at the top of the crontab (cronie) or a timezone field in Kubernetes.
- 0 9 1 * 1 runs on the 1st AND every Monday
- When both day of month and day of week are restricted, POSIX cron matches either one, not both. Restrict only one of the two, or check the date inside the script.
- Percent signs in the command break it
- In crontab, an unescaped % is turned into a newline and the rest is sent to the command's stdin. Escape it as \% (common in date +\%F).
Platform notes
Standard cron vs GitHub Actions and Kubernetes
Standard cron has five fields, in order: minute, hour, day of month, month, day of week. Each takes a single value, a list (1,15), a range (1-5), a step (*/10) or *. Sunday is 0 or 7. Names like MON and JAN work in most implementations but not all, so use numbers where portability matters. There is no seconds field, so one minute is the finest schedule standard cron supports.
Restrict only one of the two day fields. When both day of month and day of week are restricted, the job runs when either matches, so 0 0 13 * 5 fires on the 13th of every month and also every Friday, not on Friday the 13th. Check the target system before you copy an expression: Quartz (Java) and some SaaS schedulers use a six or seven field syntax with ? and L, so a string that works in one place can fail or mean something else in another.
Manuals
crontab(5) schedule reference
Guides
Guides and tutorials
- Unix Timestamp to Date in JavaScript, PHP, Python and MySQL Convert Unix timestamps to dates in JavaScript, PHP, Python, MySQL and PostgreSQL: seconds vs ms, time zones, DST and the 2038 limit. Read guide →
- Cron Expression Cheat Sheet With 30 Examples The five cron fields, every special character, and 30 ready-to-copy schedules in plain English, plus time zone pitfalls and how each cron platform differs. Read guide →
Q&A
Cron schedule generator questions
What do the five fields of a cron expression mean?
From left to right: minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-6, Sunday is 0; most implementations also accept 7). An asterisk means every value.
How do I run a job every 15 minutes?
On the Minute tab, choose Every and type 15 into the minute(s) box. The expression is */15 * * * *.
Does this work with crontab, Kubernetes CronJob and GitHub Actions?
Yes. All three use the standard five-field syntax. Quartz adds a seconds field and AWS EventBridge adds a year field, so add those by hand when you target them. The Last day of the month option writes L, which standard crontab does not accept.
Which time zone does cron use?
The time zone of the machine or service running the job, which is usually UTC on servers. Convert your intended local time to that zone before you schedule. For example, 09:00 in New York during daylight saving time is 13:00 UTC.
Can I combine day of month and day of week?
Yes, but in standard cron the job runs when either field matches. For example, 0 0 13 * 5 fires on every 13th and on every Friday. Restrict one of the two fields and check the other inside your script.