Quartz cronexpression expression

Source: Internet
Author: User

Format: second minute hour day month week Year

Serial number Description Required Value Wildcard
1
Seconds Yes 0-59 ,-*/
2
Minute Yes 0-59 ,-*/
3
Hour 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 of every month, but do not care about the number of weeks,

So the field at the weekly location is set "? "Set to 0 0 0 10 *?

-Indicates the interval.

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 month (based on the current month, if it is February, it will also be based on whether it is a runyear [leap]),

The week field indicates Saturday, which 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 this month"

WThe business day closest to the specified date (Monday to Friday ).

For example, if "15 W" is set on the daily field, it indicates that the trigger is triggered on the workday closest to the 15th day of each month.

If it is Saturday on the 15th, It is triggered on the latest Friday (14th,

If the week is not completed on the 15th, It is 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 inter-zone "-" is not allowed "-").

#Serial 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 each month.

NOTE: If "6 #5" is specified, this configuration will not be triggered if there is no Saturday in week 5;

TIPS: 'l' and 'w' can be used in combination.

If "LW" is set on the daily field, it is triggered on the last workday of the month;

Weekly field settings. If you use English letters, they are case-insensitive, that is, Mon and Mon are the same;

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 **? 02:59 pm to PM, PM to PM (triggered every 5 minutes starting from pm)

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 December 31, 2005

0 15 10? * 6 #3 triggered on Friday of the third week of each 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)

Quartz cronexpression expression

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.