Cron FAQ & Documentation
Everything you need to know about standard UNIX cron, extended 6-field formats, timezones, and syntax rules.
What is a cron expression?
A cron expression is a string of five or six fields separated by spaces that represents a set of times. It is used by the cron daemon to execute scheduled background tasks on Unix-like operating systems.
What does this cron expression mean?
To understand what a specific cron expression means, you can break it down into its five standard fields: Minute, Hour, Day of the Month, Month, and Day of the Week. Using our free cron generator at the top of this page will instantly translate any complex syntax into plain, human-readable English.
What is cron expression?
Cron expression is a standard scheduling language used by servers to automate repetitive tasks. Each field in the expression acts as a time filter, and a scheduled script will only execute when the current system time matches all the filters defined in the string.
What is this cron expression?
If you are asking 'what is this cron expression' about a string you found in a server configuration file, simply paste it into the decoder box above. It will break down the exact minute, hour, day, and month the schedule is configured to run, alongside the next five upcoming execution times.
How to read cron expression?
To read a cron expression, scan it from left to right. The first position is the Minute (0-59), the second is the Hour (0-23), the third is the Day of the Month (1-31), the fourth is the Month (1-12), and the fifth is the Day of the Week (0-6, where 0 is Sunday). An asterisk (*) means 'every'.
What is a cron job?
A cron job is an automated background task scheduled to run at specific intervals on a server. System administrators and developers use cron jobs for routine maintenance tasks like taking database backups, sending out daily email reports, or rotating server log files.
What is a cron job in Linux?
In Linux, a cron job is a script or command executed automatically by the crond daemon at a specified time. It allows Linux users to schedule repetitive system tasks without manual intervention. The schedules are defined inside a hidden configuration file called a crontab.
cPanel how to check cron job running?
To check if a cron job is running in cPanel, log into your cPanel dashboard and navigate to the 'Advanced' section. Click on 'Cron Jobs'. Here you can see a list of all scheduled tasks. To verify they are actually executing successfully, you should append an email address in the 'Cron Email' section so cPanel sends you an output report every time the job runs.
What is cron?
Cron is a time-based job scheduling utility built into Unix-like operating systems. Named after Chronos, the Greek personification of time, it runs silently in the background and wakes up every minute to check if any scheduled commands in the crontab files need to be executed.
How do I schedule a cron job every 5 minutes?
Use the expression */5 * * * *. The */5 in the minute field tells the system to execute the task every time the minute is divisible by 5.
What is the difference between 5-field and 6-field cron?
Standard UNIX cron uses 5 fields (Minute, Hour, Day of Month, Month, Day of Week). 6-field formats, like Quartz or AWS EventBridge, append a 'Year' field or prepend a 'Second' field for more granular control.
Does cron handle Daylight Saving Time (DST)?
It depends entirely on the system executing the cron daemon. Standard UNIX cron runs based on the server's local time. If the time jumps forward or backward during a DST transition, jobs scheduled within that specific window may be skipped entirely or executed twice. Using UTC is the safest way to avoid DST bugs.
What does the asterisk (*) mean in cron?
The asterisk means 'every'. If placed in the Minute field, it means 'every minute'. If placed in the Day of Week field, it means 'every day of the week'.
What does the comma (,) mean?
The comma is used to specify a list of values. For example, 1,15,30 in the Minute field means the job will run at minute 1, 15, and 30.
What does the hyphen (-) mean?
The hyphen specifies a range of values. For example, 1-5 in the Day of Week field means Monday through Friday.
What does the forward slash (/) mean?
The slash is used to specify step values. For example, */10 in the Minute field means 'every 10 minutes'. 5/15 means 'starting at minute 5, then every 15 minutes thereafter'.
What does the L character do?
The 'L' stands for 'Last'. When used in the Day of Month field, it means the last day of the month. When used in the Day of Week field (e.g., 5L), it means the last Friday of the month. Note: This is an extended feature and not supported by standard POSIX cron.
What does the W character mean?
The 'W' stands for 'Weekday' (Monday-Friday). If you specify 15W in the Day of Month field, cron will execute the job on the nearest weekday to the 15th of the month. If the 15th is a Saturday, it runs on Friday the 14th.
Can I use both Day of Month and Day of Week?
Yes, but they are evaluated with an OR condition in standard UNIX cron. If you specify 15 * * * 1 (15th of the month, and Monday), the job will run on the 15th of every month AND every Monday. It will NOT run only when the 15th is a Monday.
Why did my AWS EventBridge cron fail to save?
AWS EventBridge strictly requires 6 fields (adding Year at the end) and mandates that you cannot use the * character for both Day-of-Month and Day-of-Week simultaneously. One of them must be a ? (question mark).
What does the question mark (?) mean?
The question mark is used as a placeholder meaning 'no specific value'. It is required in some systems (like AWS or Quartz) when you specify a value for Day-of-Month but want to leave Day-of-Week blank, or vice versa.
Are cron expressions evaluated in my local timezone?
Cron expressions do not contain timezone data. They are evaluated based on the timezone of the server running the cron daemon. Cloud platforms like AWS EventBridge and GitHub Actions strictly evaluate expressions in UTC.
Can I schedule a job to run every second?
Not with standard 5-field UNIX cron, which only resolves down to the minute. You would need a system that supports 6-field Quartz cron (which prepends a Seconds field) or use a custom application loop.
Does Sunday evaluate to 0 or 7?
In standard UNIX cron, Sunday can be represented by either 0 or 7. Both are valid. Monday is 1, Tuesday is 2, etc.
Can I use month names like JAN or FEB?
Most modern cron implementations allow the use of three-letter abbreviations for months (JAN-DEC) and days of the week (SUN-SAT). However, these are case-insensitive and cannot always be used in lists or ranges.
What happens if a cron job overlaps with its previous run?
By default, the cron daemon will simply spawn a new process. If your script takes 10 minutes to run, but is scheduled to run every 5 minutes, two instances will run concurrently. You must implement your own locking mechanism (like a PID file) if you want to prevent overlaps.
How do I redirect cron output to a file?
You append the redirection operator to your command in the crontab file: * * * * * /path/to/script.sh > /path/to/logfile.log 2>&1.
Why doesn't my cron job have access to my environment variables?
Cron executes commands in a very stripped-down shell environment (usually /bin/sh) without loading your ~/.bashrc or ~/.profile. You must provide absolute paths to executables or source your environment variables within your script.
Can I run a job on the last weekday of the month?
Yes, in systems that support extended characters like Quartz, you can use the LW combination in the Day of Month field.
What is the hash (#) character used for?
The hash is used to specify the 'nth' occurrence of a day of the week in a month. For example, 2#3 means the 3rd Tuesday of the month.
How do I schedule a job every 2 hours?
Use 0 */2 * * *. It will run at the start of every even hour (0:00, 2:00, 4:00, etc).
Is there a limit to how many cron jobs I can run?
The cron daemon itself doesn't have a strict limit, but your operating system limits the number of open files, processes, and memory. Running thousands of heavy cron jobs simultaneously will crash your server.