Cron Expressions

Cron expressions are used to configure instances of CronTrigger, a subclass of org.quartz.Trigger. A cron expressions is a string consisting of six or seven subexpressions (fields) that describe individual details of the schedule.

These fields, separated by white space, can contain any of the allowed values with various combinations of the allowed characters for that field.
Table 1 Cron Expression Allowed Fields and Values
Name
Required
Allowed Values
Allowed Special Charaters
Seconds
Y
0-59
,-*/
Minutes
Y
0-59
,-*/
Hours
Y
0-23
,-*/
Day of month
Y
1-31
,-*?/LWC
Month
Y
0-11 or JAN-DEC
,-*/
Day of week
Y
1-7 or SUN-SAT
,-*?/LC#
Year
N
Empty or 1970-2099
,-*/

Example
Cron expression can be as simple as * * * * ? * or as complex as 0 0/5 14,18,3-39,52 ? JAN,MAR,SEP MON-FRI 2002-2010

Table 2 : Cron Expression -Example
Expression
Means
0 0 12 * * ?
Fire at 12:00 PM every day
0 15 10 * * ? *
Fire at 10:15 AM every day
0 * 14 * * ?
Fire every minute starting at 2:00 PM and ending at 2:55 PM, every day
0 15 10 ? * 6L
Fire at 10:15 AM on the last Friday of every month


 This is the original question I asked

Comments

Popular posts from this blog

OrientDB Quick Guide

Double Submit Cookies Pattern