- CRON expression
A CRON expression is a string comprised of 6 or 7 fields separated by white space [ [http://wiki.pentaho.com/display/PentahoDoc/05.+CRON+Expressions+in+Detail 05. CRON Expressions in Detail - Pentaho Wiki ] ] that represents a set of times, normally as a schedule to execute some routine. It is used primarily by the
UNIX tool "cron".Format
{| class="wikitable"
-! Field name! Mandatory?! Allowed values! Allowed special characters
-
Seconds
Yes
0-59
* / , -
-|pecial Characters
Asterisk (*)
The asterisk indicates that any value for the field is acceptable. For example, using an asterisk in the 5th field (month) would indicate every month.
Forward slashes (/)
Forward slashes are used to describe increments. For example 0/15 in the 1st field (seconds) would indicate the 0th second of the minute and every 15 seconds thereafter.
Commas (,)
Commas are used to separate items of a list. For example, using "MON,WED,FRI" in the 6th field (day of week) would mean Mondays, Wednesdays and Fridays.
Hyphen (-)
Hyphens denote ranges. For example, 2000-2010 would indicate every year between 2000 and 2010 CE inclusive.
Examples
Every second
* * * * * *Every minute
0 * * * * *23:00 every weekday night
0 0 23 ? * MON-FRIIn 2003 CE on the 11th to 16th of each month in January to June every third minute starting from 2 past 1am, 9am and 10pm
0 2/3 1,9,22 11-26 1-6 ? 2003References
Wikimedia Foundation. 2010.