Quartz Scheduler 2.1.x 英文节选(二)

2014-11-24 09:19:39 · 作者: · 浏览: 1
value of "6#3" or "FRI#3" in the day-of-weekfield means "the third Friday of the month".
Hereare a few more examples of expressions and their meanings - you can find evenmore in the JavaDoc for org.quartz.CronExpression
Example Cron Expressions
CronTriggerExample 1 - an expression to create a trigger that simply fires every 5 minutes
"0 0/5 * * * "
CronTriggerExample 2 - an expression to create a trigger that fires every 5 minutes, at 10seconds after the minute (i.e. 10:00:10 am, 10:05:10 am, etc.).
"10 0/5 * * * "
CronTriggerExample 3 - an expression to create a trigger that fires at 10:30, 11:30,12:30, and 13:30, on every Wednesday and Friday.
"0 30 10-13 * WED,FRI"
CronTriggerExample 4 - an expression to create a trigger that fires every half hourbetween the hours of 8 am and 10 am on the 5th and 20th of every month. Notethat the trigger will NOT fire at 10:00 am, just at 8:00, 8:30, 9:00 and 9:30
"0 0/30 8-9 5,20 * "
Notethat some scheduling requirements are too complicated to express with a singletrigger - such as "every 5minutes between 9:00 am and 10:00 am, and every20 minutes between 1:00 pm and 10:00 pm". The solution in this scenario isto simply create two triggers, and register both of them to run the same job.