What cron expression does easycron support?

EasyCron supports all cron expressions that you can find in general Linux Cron implementations.

Let's see some quick examples first.

Quick Examples

Expression Meaning
0 12 * * * Fire at 12pm (noon) every day
15 10 * * * Fire at 10:15am every day
15 10 * * ? Fire at 10:15am every day
* 14 * * * Fire every minute starting at 2pm and ending at 2:59pm, every day
0/5 14,18 * * * Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day
0-5 14 * * * Fire every minute starting at 2pm and ending at 2:05pm, every day
10,44 14 * 3 3 Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.
15 10 * * 1-5 Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday
15 10 15 * * Fire at 10:15am on the 15th day of every month
15 10 L * * Fire at 10:15am on the last day of every month
15 10 * * 5L Fire at 10:15am on the last Friday of every month
15 10 * * 5#3 Fire at 10:15am on the third Friday of every month
0 12 1/5 * * Fire at 12pm (noon) every 5 days every month, starting on the first day of the month.
11 11 11 11 * Fire every November 11th at 11:11am.
0 0 * * 3 Fire at midnight of each Wednesday.
0 0 1,2 * * Fire at midnight of 1st, 2nd day of each month
0 0 1,2 * 3 Fire at midnight of 1st, 2nd day of each month, and each Wednesday.

Cron Job Expression Definition

A CRON expression that EasyCron supports is a string comprising five fields separated by white space. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field. The fields are as follows:

Field Name Mandatory Allowed Values Allowed Special Characters
Minutes YES 0-59 , - * / R
Hours YES 0-23 , - * / R
Day of month YES 1-31 , - * ? / L W
Month YES 1-12 , - * /
Day of week YES 0-7 , - * ? / L #

Special characters

Asterisk ( * )
The asterisk indicates that the cron expression matches for all values of the field. E.g., using an asterisk in the 1th field (minute) indicates every minute.
Slash ( / )
Slashes describe increments of ranges. For example 3-59/15 in the 1st field (minutes) indicate the third minute of the hour and every 15 minutes thereafter. The form "*/..." is equivalent to the form "first-last/...", that is, an increment over the largest possible range of the field.
Comma ( , )
Commas are used to separate items of a list. For example, using "1,2,5" in the 5th field (day of week) means Mondays, Wednesdays and Fridays.
Hyphen ( - )
Hyphens define ranges. For example, 2000-2010 indicates every year between 2000 and 2010 AD, inclusive.
L
'L' stands for "last". When used in the day-of-week field, it allows you to specify constructs such as "the last Friday" ("5L") of a given month. In the day-of-month field, it specifies the last day of the month.
W
The 'W' character is allowed for the day-of-month field. This character is used to specify the weekday (Monday-Friday) nearest the given day. As an example, if you were to specify "15W" as the value for the day-of-month field, the meaning is: "the nearest weekday to the 15th of the month." So, if the 15th is a Saturday, the trigger fires on Friday the 14th. If the 15th is a Sunday, the trigger fires on Monday the 16th. If the 15th is a Tuesday, then it fires on Tuesday the 15th. However if you specify "1W" as the value for day- of-month, and the 1st is a Saturday, the trigger fires on Monday the 3rd, as it does not 'jump' over the boundary of a month's days. The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.
Hash ( # )
'#' is allowed for the day-of-week field, and must be followed by a number between one and five. For example, 5#2 indicates "the second Friday" of a given month.
Question mark ( ? )
It is used instead of '*' for leaving either day-of-month or day-of-week blank.

Above special characters are supported in several most popular Cron implementations (Cronie, Vixie cron and Quartz java scheduler, etc.).

Exceptional case:
While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" and "day of week" are restricted (not "*"), then either the "day of month" field (3) or the "day of week" field (5) must match the current day.

« Back to the full FAQ list
Like our service? Share with your friends