This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11600|Reply: 0

Quartz CronTrigger is the most complete configuration description

[Copy link]
Posted on 3/12/2018 10:23:08 AM | | |
CronTrigger configuration format:

Format: [Seconds] [Minutes] [Hours] [Days] [Months] [Weeks] [Years]

Serial Number Description
Whether required Values allowed to be filled Allowed wildcards
1 second is 0-59 , - * /
2 points is 0-59 , - * /
3 hours is 0-23 , - * /
4th is 1-31 , - * ? / L W
May is 1-12 or JAN-DEC , - * /
6 weeks is 1-7 or SUN-SAT , - * ? / L #
7 years No empty or 1970-2099 , - * /
Wildcard Instructions:
* Represents all values. For example, setting "*" on the field of the score indicates that it will be triggered every minute.
?Indicates that no value is specified. The scenario used is that you don't need to care about the value of this field at the moment. For example, if you want to trigger an action on the 10th of each month, but you don't care if it's the day of the week, you need to set the field of the week position to "?" is set to 0 0 0 10 * ?
-Indicates intervals. For example, setting "10-12" on the hour means that 10, 11, and 12 points will all be triggered.
,Indicates that multiple values are specified, such as setting "MON, WED, FRI" on the week field to indicate that it triggers on Monday, Wednesday, and Friday
/ Used for incremental triggering. If you set "5/15" on the second, it means that it will be triggered every 15 seconds from 5 seconds (5, 20, 35, 50). Set '1/3' on the month field to start on the 1st of each month and trigger every three days.
LIndicates the final meaning. In the day field setting, it represents the last day of the month (based on the current month, and if it is February, it will also depend on whether it is a leap year [leap]), and on the week field, it represents Saturday, which is equivalent to "7" or "SAT". If you add a number before the "L", it indicates the last of that data. For example, if you set the format "6L" on the week field, it means "Last Friday of the month"
WIndicates the most recent working day (Monday to Friday) from the specified date. For example, set "15W" on the day field to indicate that the weekday closest to the 15th of each month is triggered. If the 15th happens to be Saturday, find the nearest Friday (14th) to trigger, if the 15th is the end of the week, find the nearest next Monday (16th) to trigger. If the 15th happens to be on a weekday (Monday to Friday), it is triggered on that day. If the specified format is "1W", it indicates that it is triggered on the most recent business day after the 1st of each month. If the 1st is exactly Saturday, it will be triggered on the following Monday the 3rd. (Note, only specific numbers can be set before "W", and the interval "-") is not allowed).
Tips
'L' and 'W' can be used in combination. If you set "LW" on the day field, it means that it will be triggered on the last working day of the month (usually referring to payroll)

#Serial number (indicating the day of the week of the month), for example, setting "6#3" on the week field means on the third Saturday of the month. Note that if you specify "#5", it will not trigger this configuration if there is no Saturday in the fifth week (perfect for Mother's Day and Father's Day)
Tips
The setting of the week field is the same as mon, if you use English letters, it is the same as mon.

Common examples:

0 0 12 * * ?        Triggers at 12 o'clock every day
0 15 10 ? * * Triggers every day at 10:15
0 15 10 * * ?        Triggered at 10:15 every day
0 15 10 * * ? * Triggers every day at 10:15
0 15 10 * * ? 2005 2005 Triggered at 10:15 every day
0 * 14 * * ?        Triggers every minute from 2 pm to 2:59 pm every day
0 0/5 14 * * ?        2pm to 2:59pm daily (starts on the hour, triggers every 5 minutes)
0 0/5 14,18 * * ?        2pm to 2:59pm daily (starts on the hour, triggers every 5 minutes)
Every afternoon from 18:00 to 18:59 (starts at hour, triggers every 5 minutes)
0 0-5 14 * * ?        Triggers every minute from 2:05 pm to 2:05 pm every day
0 10,44 14 ? 3 WED is triggered every Wednesday at 2:10 p.m. and 2:44 p.m. in March
0 15 10 ? * MON-FRI is triggered at 10:15 a.m. every day from Monday to Friday
0 15 10 15 * ?        It will be triggered at 10:15 a.m. on the 15th of each month
0 15 10 L * ?        Triggered at 10:15 on the last day of each month
0 15 10 ? * 6L triggers at 10:15 on the last Friday of each month
0 15 10 ? * 6L 2002-2005 Triggered at 10:15 on the Friday of the last week of each month from 2002 to 2005
0 15 10 ? * 6#3 Triggers start on the Friday of the third week of each month
0 0 12 1/5 * ?        Triggers every 5 days starting at the first noon of each month
0 11 11 11 11 ?        Triggered every year on November 11th at 11:11 (Singles' Day)





Previous:Oracle+11G configuration PLSQL guide
Next:A misconfiguration defines duplicate system.web.extensions/scrip{filtering}ting/scrip{...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com