Home › Cron FAQ
Cron Job FAQ
Answers to the most common questions about cron expressions, cron syntax and cron job scheduling.
What is a cron expression?
Five numbers (or wildcards) separated by spaces that tell the cron daemon when to run a command.
In order: minute, hour, day of month, month, day of week.
0 9 * * 1-5 means "at 9:00 AM, every day where the day is Monday through Friday".
That is the whole thing. The syntax looks cryptic but there are only five fields and each has a clear range.
What is a cron job?
A cron job is a script or command that runs automatically on a schedule. The cron daemon wakes up every minute, checks the crontab for any jobs due to run, and fires them. It does not care whether the previous run finished, succeeded or crashed - it will run again on schedule regardless. That last point causes more production incidents than the syntax ever does.
What does */5 * * * * mean?
Every 5 minutes. The / means "step" - so */5 in the minute field means
"starting from 0, every 5 steps": at :00, :05, :10, :15... :55.
The same logic works in any field: */2 in the hour field means every 2 hours,
*/3 in the month field means every 3 months.
It always starts from the lowest valid value, not from when the job was first scheduled.
What is the cron expression 30 4 1,15 * 5?
This one tricks almost everyone. It runs at 4:30 AM on the 1st and 15th of every month,
but also at 4:30 AM every Friday - because Linux cron uses OR logic when both
day-of-month and day-of-week are set. Most people expect AND (run only on Fridays that fall on the 1st or 15th).
If you need AND logic, you have to check the date inside the script itself.
In Quartz and AWS EventBridge, you must set one of those fields to ? to avoid the ambiguity entirely.
What is a 7-field cron expression?
Quartz Scheduler (Java) adds a Seconds field at the start and an optional Year field at the end,
giving 6 or 7 fields total: seconds minutes hours dom month dow year.
So 0 30 9 ? * MON-FRI means "at exactly 9:30:00 AM on weekdays".
Spring Boot uses the same 6-field format for @Scheduled(cron = "...").
If your expression has 6 fields and the first one is 0, you are almost certainly looking at Quartz or Spring, not Linux cron.
Why is my cron job not running?
In order of how often we have seen each one:
- Wrong PATH - cron's PATH is
/usr/bin:/bin. Yourphp,nodeorpythonare probably not there. Use full paths. - No output captured - the job ran, failed silently, and you have no log. Add
>> /var/log/myjob.log 2>&1. - Wrong timezone - you think it is 2 AM but the server is in UTC. Run
timedatectl. - Script not executable -
chmod +x /path/to/script.sh - Cron daemon not running -
systemctl status cronorsystemctl status crond - Invalid syntax - paste it in our Cron Checker before anything else
What is the difference between cron and crontab?
Cron is the daemon - the process running in the background that wakes up every minute and runs scheduled jobs.
Crontab is two things at once: the file where your schedules live, and the command (crontab -e) you use to edit it.
When someone says "add it to your crontab" they mean edit the file. When they say "cron will run it" they mean the daemon will execute it.
How does AWS EventBridge cron differ from Linux cron?
Three things to know before you copy a Linux expression into EventBridge and wonder why it fails.
First, EventBridge requires a 6th field for Year - * works fine.
Second, you cannot specify both day-of-month and day-of-week - one of them must be ?.
Third, everything is UTC, always, with no option to change it.
Example: Linux 0 9 * * 1-5 becomes EventBridge 0 9 ? * MON-FRI *.
What does the ? operator mean in cron?
It means "I do not care about this field". Used only in day-of-month or day-of-week,
and only in Quartz, Spring Boot and AWS EventBridge - not in Linux cron.
The reason it exists is to resolve the AND/OR ambiguity: if you set day-of-week to MON,
you need to put ? in day-of-month to say "any day of month is fine".
Without ?, Quartz does not know which field takes priority.
How do I run a cron job every weekday?
Linux: 0 9 * * 1-5 (or 0 9 * * MON-FRI - both work).
Quartz / Spring Boot: 0 0 9 ? * MON-FRI.
AWS EventBridge: 0 9 ? * MON-FRI *.
One thing people miss: 1-5 in the day-of-week field means Monday to Friday.
Day 0 and day 7 are both Sunday in Linux cron - either works.
Can I run a cron job every second?
Not with Linux cron - the minimum granularity is one minute.
If you genuinely need per-second execution, you are looking at the wrong tool.
Quartz Scheduler supports seconds. So does node-cron (with its 6-field variant) and Celery Beat for Python.
A common workaround for Linux is to chain commands inside a single cron job:
* * * * * /script.sh; sleep 30; /script.sh - runs twice per minute, every 30 seconds.
Not elegant, but it works.
What is the difference between @daily and 0 0 * * *?
Nothing. @daily is a shorthand macro that expands to exactly 0 0 * * *.
Use whichever makes the intent clearer to whoever reads the crontab next.
The full list: @hourly, @daily / @midnight,
@weekly, @monthly, @yearly / @annually,
and @reboot which runs once when the system starts.
These macros are not supported by Quartz or AWS EventBridge - only Linux crontab.
Build and validate your cron expression instantly