spring timer specification

0 0 1 * * ? triggers "0 0 12 * * ?" every day at 1:00 AM Every day at
12:00 noon triggers
"0 15 10 ? * *" every day at 10:15 a.m. triggers
"0 15 10 * * ?" every day at 10:15 a.m. Triggers
"0 15 10 * * ? *" every day at 10:15 am triggers
"0 15 10 * * ? 2005" every day in 2005 at 10:15 am triggers
"0 * 14 * * ?" every day from 2 pm to 2 pm "0 0/5 14 * * ?" fires every 1 minute during :59
every 5 minutes between 2 pm and 2:55 pm every day
"0 0/5 14,18 * * ?" every 2 pm Fires "0 0-5 14 * * ?" every 5 minutes between 2:55 pm and 6:05
pm and every 1 minute between 2:00 pm and 2:05 pm every day
"0 10, 44 14 ? 3 WED" Triggers "0 15 10 ? * MON-FRI" at 2:10 pm and 2:44 pm every Wednesday in March every year "0 15 10 ? * MON-FRI" triggers "0 15 10 15 * ?"
at 10:15 am Monday to Friday "0 15 10 L * ?"
fires at 10:15 AM on the 15th
of the month "0 15 10 ? * 6L" fires at 10:15 AM on the last day of the month
"0 15 10 ? * 6L" on the last Friday of the month at 10:00 AM 15 Trigger
"0 15 10 ? * 6L 2002-2005" Triggered at 10:15 am on the last Friday of every month from 2002 to 2005
"0 15 10 ? * 6#3" Triggered on the third Friday of every month at 10:15 am

---------------- Character specification
0/5 * * * * ? : every Executed once every 5 seconds, the

"*" character is used to specify all values. For example: "*" means "every minute" in the field of minutes.
The "?" character is only used in date and week fields. It is used to specify "non-explicit values". It is useful when you need to specify something via one of these two fields. Look at the example below and you will understand.
The day of the month and day of the week elements, when mutually exclusive, should be indicated by setting a question mark to indicate that you do not want to set that field.

The "-" character is used to specify a range. For example: "10-12" means "10 o'clock, 11 o'clock, 12 o'clock" in the hour field.

The "," character is used to specify additional values. For example: "MON, WED, FRI" means "Monday, Wednesday, Friday" in the week field.

The "/" character is used to specify the increment. For example: "0/15" in the seconds field means 0, 15, 30 and 45 seconds per minute. "5/15" in the minutes field means 5, 20, 35 and 50 of the hour. The symbol "*" before "/" (eg: */10) is equivalent to 0 before "/" (eg: 0/10). Remember the essence: each numeric field of the expression is a set with a maximum and minimum value, such as: the set of seconds and minutes fields is 0-59, the date field is 1-31, and the month field is 1- 12. The character "/" can help you to take the corresponding value in each character field. For example, when "7/6" is in the month field, it will only be triggered in July, not every June.

L is the abbreviation of 'last', which can represent the day-of-month and day-of-week fields, but has different meanings in the two fields, such as the last day of the month in the day-of-month field. If it means '7' or 'SAT' in the day-of-week field, if a number is added in front of the day-of-week field, it means the last day of the month, for example '6L' means the last day of the month a friday.

The character "W" is only allowed for date fields. This character is used to specify the most recent weekday of the date. For example: if you write "15W" in the date field, it means: the nearest working day on the 15th of this month. So, if the 15th is a Saturday, the task will trigger on the 14th. If the 15th falls on a Sunday, the task will trigger on Monday the 16th. If you fill in "1W" in the date field, even if the 1st is Saturday, the task will only be triggered on the next Monday, that is, the 3rd. The most recent working day specified by the "W" character cannot span months. The character "W" can only be used with a single numerical value, not a numerical field, such as: 1-15W is wrong.

"L" and "W" can be used in conjunction in the date field, with LW representing the weekday of the last week of the month.

The character "#" is only allowed in the week field. This character is used to specify the day of the month. For example: "6#3" means Friday of the third week of the month (6 means Friday, 3 means the third week). "2#1" means Monday of the first week of the month. "4#5" means Wednesday of the fifth week.

The character "C" is allowed in date and day fields. This character relies on a designated "calendar". That is to say, the value of this expression depends on the calculation result of the related "calendar". If there is no "calendar" associated, it is equivalent to all the contained "calendars". For example, if the date field is "5C", it means the first day in the associated "calendar", or the last 5 days of the first day of the month. The week field is "1C", which means the first day in the associated "calendar", or the day after the first day of the week, that is, the day after Sunday (Monday).

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326037548&siteId=291194637