Cron is a time-based job scheduler built into Unix-like operating systems including Linux and macOS. It lets you automate repetitive tasks, running backups at midnight, clearing temporary files every Sunday, sending reports every Monday morning. The catch? You have to express your schedule using a cryptic five-field syntax that nobody memorizes. That string 0 5 * * 1 means “5:00 AM every Monday,” but good luck remembering that six months from now when you need to change it.
This generator solves a simple problem: you know when you want something to run, but you don’t want to look up the syntax every time. Instead of Googling “cron every 15 minutes” for the hundredth time, you can click a few buttons and get the exact expression you need. The tool also works in reverse—paste an existing cron expression and see a plain English explanation of what it does. That’s useful when you inherit someone else’s server and find a dozen cron jobs with no documentation.
Also, try our YAML ⇄ JSON Converter
How to Use This Crontab Generator
Natural Language Mode (Recommended for beginners)
- Select how often the job should run: Every Minute, Hourly, Daily, Weekly, Monthly, or Yearly.
- Pick the time using the hour and minute dropdowns.
- For weekly schedules, click the days you want (Mon, Tue, Wed, etc.).
- For monthly or yearly schedules, select the day of the month.
- Copy the generated expression from the right panel.
Advanced Mode
- Switch to the Advanced tab if you need precise control over individual fields.
- Each field (minute, hour, day, month, day of week) has its own editor.
- Choose from Any, Specific value, Step interval, Range, or multiple selections.
- The expression updates in real time as you make changes.
Explain Mode
- Switch to the Explain tab.
- Paste any cron expression into the input field.
- Read the human-friendly translation that appears below.
Cron Expression Format
Every cron expression has five fields separated by spaces. Here’s what each position means:
| Position | Field | Allowed Values | Special Characters |
|---|---|---|---|
| 1 | Minute | 0–59 | * , – / |
| 2 | Hour | 0–23 | * , – / |
| 3 | Day of Month | 1–31 | * , – / |
| 4 | Month | 1–12 | * , – / |
| 5 | Day of Week | 0–6 (Sun=0) | * , – / |
Special character meanings:
*matches any value,separates multiple values (e.g.,1,3,5)-defines a range (e.g.,1-5means Monday through Friday)/specifies intervals (e.g.,*/15means every 15 units)
Common Cron Schedule Examples
| Schedule | Expression | Explanation |
|---|---|---|
| Every minute | * * * * * | Runs 60 times per hour |
| Every 5 minutes | */5 * * * * | Runs 12 times per hour |
| Every hour at minute 0 | 0 * * * * | Runs 24 times per day |
| Daily at midnight | 0 0 * * * | Runs once at 12:00 AM |
| Daily at 6 AM | 0 6 * * * | Runs once at 6:00 AM |
| Every Monday at 9 AM | 0 9 * * 1 | Weekly, start of business |
| Weekdays at 9 AM | 0 9 * * 1-5 | Mon–Fri, skips weekends |
| First of every month | 0 0 1 * * | Monthly at midnight on the 1st |
| Every 6 hours | 0 */6 * * * | Runs at 12 AM, 6 AM, 12 PM, 6 PM |
| Twice daily (9 AM & 6 PM) | 0 9,18 * * * | Morning and evening |
Linux Cron Commands You Should Know
Once you have your expression, here’s how to use it on a Linux or macOS system:
- Edit your crontab:
crontab -eopens your personal cron file in a text editor. - List current jobs:
crontab -lshows all scheduled tasks for your user. - Remove all jobs:
crontab -rdeletes your entire crontab (use carefully). - Edit another user’s crontab:
sudo crontab -u username -e(requires root access).
A typical crontab entry looks like this:
0 6 * * * /home/user/scripts/backup.sh
This runs backup.sh every day at 6:00 AM.
Frequently Asked Questions
What time zone does cron use?
Cron uses your server’s system time zone. Run the date command to check what time your server thinks it is. If your server is in UTC but you’re scheduling for local time, you’ll need to convert manually or change the server’s time zone.
Why didn’t my cron job run?
Common causes include: incorrect file permissions on your script, missing environment variables (cron runs with a minimal environment), or the script path isn’t absolute. Check /var/log/syslog or /var/log/cron for error messages.
What’s the difference between crontab and cron.d?
Your personal crontab (edited with crontab -e) is for user-specific jobs. System-wide jobs go in /etc/crontab or as individual files in /etc/cron.d/. The system files have an extra field for specifying which user should run the command.
Can I run a job every 90 minutes?
Not directly. Cron works in fixed intervals within each field. For 90-minute intervals, you’d need to schedule multiple jobs or use a different scheduler. A workaround is running every 30 minutes and having your script check whether it should actually execute.
Does day of month AND day of week both have to match?
No, they’re combined with OR logic. If you set day of month to 15 and day of week to Monday, the job runs on every 15th and every Monday, not just Mondays that fall on the 15th.
