spring regular tasks (@Scheduled notes) cron expression Detailed

Reprinted from: https://www.cnblogs.com/rinack/p/6768032.html

 

Detailed cron expression:

A cron expression of at least 6 (and possibly 7) has time elements separated by spaces.

Copy the code
According to the order of 
one second (0 to 59) 
2 minutes (0 to 59) 
3 hours (0 to 23) 
four days (0 to 31) 
May (0 to 11) 
6 weeks (1 ~ 7 1 = SUN or SUN , the MON, the TUE, WEDs, the THU, the FRI, the SAT) 
7. The Year (1970-2099) 
in which each element can be a value (e.g., 6), a continuous section (9-12), a time interval (8-18 / 4) (/ indicates every 4 hours), a list (1,3,5), wildcard. 
As the "day of the month" and "date of the week," these two elements are mutually exclusive, and must be for one of the settings?. 00 10,14,16 * *? 10 am every day, 14:00, 4 point 0 0/30 * 9-17 *? inward nine to five hours every half hour 0 0 12? * WED 12:00 every Wednesday expressed "0012 * *?" 12:00 every day trigger "015 10? * * "at 10:15 am every day trigger " 01510 * *? "10:15 am every day trigger " 01510 * * *? "10:15 am every day trigger " 01510 * *? 2005 "2005 10:15 am every day of the trigger , "0 * 14 * *?" trigger per minute during the day at 2:00 pm to 2:59 pm "0 0/5 14 * *?" "? "Character is used only two sub-day (month) and day (week) expression that do not specify a value The SAT " " * "character represents all possible values " / "character is used to increment a specified value , for example: in the subexpression (minutes) in the" 0/15 "starts from 0 minutes, every 15 minutes in the sub expression (min) in the "3/20" indicates the start of the 3 minutes, every 20 minutes (it "3,23,43") meaning as when one of the two sub-expression which is assigned a value after to avoid conflicts, it is necessary to set the value of the other sub-expression "? " " L "character is used only two sub-day (month) and day (week) expression, which is an abbreviation of the word" last "is if there are specific content in the" L "before, it has other meanings of. For example: "6L" represents the inverse of this 6th day of month Note: When using the "L" parameter, do not specify the list or range, as this will cause problems W character represents the weekday (Mon-Fri), and can only be used for field day. It is used to specify the closest to a given day on weekdays. Most business processes are based on the work week, so W character may be very important. For example, Japanese domain 15W means "a number of the nearest month 15 weekdays." If the 15th is a Saturday, the trigger will trigger number (Friday) 14, because more recent than Monday from Thursday 15th. C: represents the "Calendar" means. It means the date of the associated program, if the date is not associated with, the calendar equivalent of all dates. For example 5C in the date field is equivalent to the first calendar day after the 5th.
1C corresponds to the field of the week Sunday after the first day. Field allows values allow special characters seconds 0-59, - * / min 0-59, - * / h 0-23, - * / Date 1-31, -? * / LWC March 1-12 or JAN-DEC, - * / week 1-7 or SUN-SAT, -? * / LC # years (optional) left blank, 1970-2099, - * /
Copy the code

Guess you like

Origin www.cnblogs.com/Garnett-Boy/p/11075545.html