Quartz crontrigger complete configuration instructions

Source: Internet
Author: User
Quartz crontrigger complete configuration instructions

Crontrigger configuration format:

Format: [second] [minute] [hour] [Day] [month] [week] [year]

Serial number Description Required Value that can be entered Allowed wildcard characters
1 Seconds Yes 0-59 ,-*/
2 Minute Yes 0-59 ,-*/
3 Hours Yes 0-23 ,-*/
4 Day Yes 1-31 ,-*? /L w
5 Month Yes 1-12 or JAN-DEC ,-*/
6 Week Yes 1-7 or sun-Sat ,-*? /L #
7 Year No Empty or 1970-2099 ,-*/


Wildcard description:
* Indicates all values. For example, if "*" is set on the shard field, it indicates that each minute is triggered.
?Indicates that no value is specified. In this scenario, you do not need to care about the value of this field. For example, if you want to trigger an operation on the 10th day of each month, but do not care about the number of weeks, you need to set the field of the week location "? "Set to 0 0 0 10 *?
-Range. For example, if "10-12" is set on the hour, it indicates that the event will be triggered at, 11, and 12.
,Indicates that multiple values are specified. For example, if "mon, wed, Fri" is set on the weekly field, it indicates that the trigger is performed on Monday, Wednesday, and Friday.
/ Used for incremental triggering. For example, if "5/15" is set on the second, the trigger is triggered every 15 seconds (,) starting from 5 seconds ). Set '20140901' on the monthly field to start on the first day of every month and trigger once every three days.
LIndicates the last meaning. In the day field setting, it indicates the last day of the current month (based on the current month, if it is February, it will also be based on whether it is the runyear [leap]), in the week field, it indicates Saturday, it is equivalent to "7" or "sat ". If you add a number before "L", it indicates the last data. For example, if the format "6l" is set on the weekly field, it indicates "last Friday of the month"
WIndicates the business day closest to the specified date (Monday to Friday). For example, if "15 W" is set in the day field, it indicates the business day closest to the 15th day of each month. If it is Saturday on the 15th, it will be triggered on the latest Friday (14). If the 15th is not a week, it will be triggered on the latest Monday (16. if the 15th day is on a business day (Monday to Friday), it is triggered on that day. If the specified format is "1 W", it indicates the last workday triggered after the first day of every month. If the first day is Saturday, it will be triggered on the third day next Monday. (Note: Only specific numbers can be set before "W", and "-" is not allowed "-").

Tips

'L' and 'w' can be combined. If "LW" is set on the daily field, it indicates that it is triggered on the last workday of the month (generally pay-as-you-go)

#Number (the number of weeks in a month). For example, if "6 #3" is set in the week field, it indicates the Third Saturday of a month. NOTE: If "#5" is specified, this configuration will not be triggered if there is no Saturday in the fifth week. (This configuration is not suitable for Mother's Day and Father's Day)

Tips

Weekly field settings. If you use English letters, they are case-insensitive.Mon Same as Mon.



Common examples:

0 0 12 **? Triggered at every day
0 15 10? ** Triggered at every day
0 15 10 **? Triggered at every day
0 15 10 **? * Triggered at every day
0 15 10 **? 2005 Triggered at every day on January 1, 2005
0*14 **? Triggered every minute from 02:59.
0 0/5 14 **? From 02:59 to every afternoon (triggered every 5 minutes starting from)
0 0/5 **? From 02:59 to every afternoon (triggered every 5 minutes starting from)
PM to PM (triggered every 5 minutes starting from)
0 0-5 14 **? Triggered every minute from 02:05.
0 10, 44 14? 3 wed Triggered at 02:10 and 02:44 every Wednesday, January 1, March
0 15 10? * MON-FRI Triggered at every day from Monday to Friday
0 15 10 15 *? Triggered at 10:15 A.M. on the 15th of every month
0 15 10 L *? Triggered at on the last day of each month
0 15 10? * 6l Triggered at on Friday of the last week of each month
0 15 10? * 6l 2002-2005 Triggered at on Friday of the last week of each month from January 1, 2002 to January 1, 2005
0 15 10? * 6 #3 Triggered on Friday of the third week of every month
0 0 12 1/5 *? Triggered every five days from the first noon of each month.
0 11 11 11 11? Triggered at on January 11, November 11 every year (Singles' Day)


Original Author. For more information, see the source.

Good luck!
Yours Matthew!

Quartz crontrigger complete configuration instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.