Crontrigger
Crontriggers tend to be more useful than simpletrigger if you need a calendar-based concept, rather than simpletrigger a fully specified time interval, recurrence of the launch work schedule.
Crontrigger, you can specify a trigger schedule such as "Every Friday noon", or "every weekday 9:30", or even "every 5 minutes 9:00 and 10:00 per Monday a.m., Wednesday Friday".
Even so, like Simpletrigger, Crontrigger owns the starttime when the specified timesheet is in effect, and the specified timesheet should stop (optional) the end time.
Cron Expressions
The cron expression is used to configure the Crontrigger instance.
The cron expression is a string, which is actually a schedule of seven sub-expressions that describe individual details.
These sub-expressions are separate blanks, which represent:
- Seconds
- Minutes
- Hours
- day-of-month
- Month
- Day-of-week
- Year ( optional field )
Example "0 0 12? * WED "at every Wednesday 12:00, individual sub-expressions can contain ranges;
For example, in the previous example ("WED") can be replaced by "Mon-fri", "MON, WED, FRI" or even "Mon-wed,sat". " * "represents the entire time period.
Each field has a set of valid values that can be specified, such as
Seconds (seconds) : Can be expressed as the number 0------ Minutes : Can be represented by the number 0------- , Hours (time) : You can use the number 0 -23,day-of-month : You can use any of the one by one values in the number 1-X, but pay attention to some special months month (month) : You can use 0- One or use the string "JAN, FEB, MAR, APR, May, June, JUL,-of-week, SEP, OCT, NOV and DEC" meansDay (weekly): can be represented by the number 1-7 (
1 = Sunday) or Word Fukou string "SUN, MON, TUE, WED, THU, FRI and SAT"
"/": For a special unit, expressed as "each", such as "0/15" means to execute every 15 minutes, "0" is expressed as starting from "0", "3/20" means to execute every 20 minutes, "3" for the 3rd minute start of execution
“?” : Indicates a day of the month, or a day of the week
"L": For each month, or weekly, expressed as the last day of the month, or the last week of each month as "6L" means "last Friday of the month"
"W": indicated as the most recent weekday, as "15W" is placed on the monthly (day-of-month) field as "the most recent working day of 15th this month"
"#": Is used to specify "the" nth working day of the month, the example in the weekly (Day-of-week) This field is "6#3" or "fri#3" means "third Friday per month"
1) Cron expression format: Second-time time-of-year (optional).
Allowed special characters for field name allowed values
Seconds 0-59,-*/
Sub 0-59,-*/
Hours 0-23,-*/
Day 1-31,-*? /L W C
Month 1-12 or JAN-DEC,-*/
How many weeks 1-7 or SUN-SAT,-*? /L C #
Year (optional field) empty, 1970-2099,-*/
“?” Character: Represents an indeterminate value
"," character: Specify a number of values
"-" character: Specifies the range of a value
"/" character: Specifies the increment of a value. N/m means starting with N, increasing m each time
"L" character: Used on the last day of the one month, used in the week to represent the last one weeks of the month X
"W" character: Specifies the most recent weekday from the given date (Monday to Friday)
The "#" character: The number of weeks that the month is X. 6#3 said the 3rd Friday of the Month
2) Cron Expression Example:
Executes every 5 seconds: */5* * * * ?run every 1 minutes:0*/1* * * ?executed at 23 o ' Day:0 0 at* * ?once daily 1 o'clock in the morning:0 0 1* * ?every month, 1th, 1 o'clock in the morning, is executed once:0 0 1 1* ?The last day of the month is performed at 23 points:0 0 atL *?once a week, Sunday 1 o'clock in the morning:0 0 1? *L Execute at 26, 29, and 33 minutes:0 -, in, -* * * ?every day, 0, 13, 18, 21 points are executed once:0 0 0, -, -, +* * ?
Every day from 7 to 21 is performed once: 0 0 7-21 * *?
Reprinted from:http://www.cnblogs.com/sunjie9606/archive/2012/03/15/2397626.html
QuartZ cron Expressions