Cron Expression Generator & Explainer – Crontab Schedule Simulator
Interactive Dropdown Builder
Next 10 Scheduled Executions
- Calculating upcoming execution times...
Crontab Special Characters
| * | Any value: Matches every instance in the field (e.g. every minute). |
| , | Value list separator: Matches multiple specific values (e.g. 1,15,30). |
| - | Range: Defines inclusive range of values (e.g. 1-5 for Mon-Fri). |
| / | Step values: Specifies increments (e.g. */10 for every 10 units). |
| @daily | Standard shortcut: Equivalent to 0 0 * * * (midnight daily). |
What is Cron and Crontab?
Cron is a time-based job scheduler in Unix-like computer operating systems. Software developers, system administrators, and DevOps teams configure cron jobs via crontab files to automate recurring tasks such as database backups, SSL certificate renewals, cache invalidations, and email digest dispatches.
Standard 5-Field Cron Syntax Explained
┌───────────── Minute (0 - 59)
│ ┌───────────── Hour (0 - 23)
│ │ ┌───────────── Day of the Month (1 - 31)
│ │ │ ┌───────────── Month of the Year (1 - 12 or JAN - DEC)
│ │ │ │ ┌───────────── Day of the Week (0 - 6, where 0 is Sunday, or SUN - SAT)
│ │ │ │ │
* * * * * command_to_execute
Timezones & Production Cron Pitfalls
- Server Clock vs Local Time: Cloud virtual machines (AWS EC2, Google Cloud, DigitalOcean) default to UTC. A cron job set for
0 2 * * *(2:00 AM) runs at 2:00 AM UTC, not your local office timezone unless configured viaCRON_TZ=America/New_York. - Overlapping Jobs: If a long-running batch job takes 7 minutes to execute but is scheduled to run every 5 minutes (
*/5 * * * *), concurrent instances will spawn and cause database locks. Use lock utilities likeflock -n /var/lock/myjob.lockto ensure exclusivity. - Path Environment Variables: Cron executes in a minimal shell environment without your user's
.bashrcor$PATH. Always supply absolute paths (e.g./usr/bin/python3 /opt/app/script.py) and redirect standard output/error to a logfile:>> /var/log/myjob.log 2>&1.
Frequently asked questions
What does */5 mean in a cron expression?
The slash (/) denotes a step increment. In the first position (minute), */5 means 'every 5 minutes' starting at minute 0 (0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55).
Does day-of-week 0 or 7 represent Sunday?
In standard Unix cron and Vixie cron, both 0 and 7 represent Sunday. 1 is Monday, 2 is Tuesday, up through 6 for Saturday.
What happens if both Day of Month and Day of Week are set?
Under standard POSIX cron specification, if both fields are specified (not asterisks), cron executes the command when EITHER condition is true (an OR operation), rather than requiring both to match.
How do I edit my server's crontab?
In your terminal, execute 'crontab -e' to edit your user crontab in nano or vim. To list active scheduled jobs, run 'crontab -l'.