cron expression
By modifying the cron expression, execute the script regularly
Learn the basic writing of cron expressions
1, cron 6-digit expression

From left to right
The first digit represents
seconds, only numbers between0-59are allowedThe second digit represents
minutes, only numbers between0-59are allowed, and60is not allowedThe third digit represents
hour, only numbers between0-23are allowed, and24is not allowed at 12 o'clock in the morningThe fourth digit represents
Day, only numbers between1-31are allowedThe fifth digit represents
month, only numbers between1-12are allowedThe sixth digit represents
week, only numbers between0-7are allowed,0and7both represent Sunday
- Cron 5-digit expression

From left to right
The first digit represents
minutes, only numbers between0-59are allowed, and60is not allowedThe second digit stands for
hour, only numbers between0-23are allowed, and24is not allowed at 12 o'clock in the morningThe third digit represents
Day, only numbers between1-31are allowedThe fourth digit represents
month, only numbers between1-12are allowedThe fifth digit represents
week, only numbers between0-7are allowed,0and7both represent Sunday
- Special characters
,stands forand, such as0 0,12,18 * * *means `execute once every day at 0 o'clock, 12 o'clock, and 18 o'clock)*stands forany value, such as* * * * *stands forexecute every minute/stands forevery, such as10-20/5 * * * *stands for the 10th-20th minute of every hour, which is executed every 5 minutes, namely the 10th minute, 15th minute, and 20th minute Minutes`- Special case: you can omit
/1when you want to express that it will be executed every 1 minute
- Special case: you can omit
- Error demonstration
60 * * * * *Ideal: Execute once every 60th second of every minute. Actual: Unable to execute. Reason:60is not allowed in thesecondbit. Correct expression:0 * * * * ** 12-18 * * *Ideal: It will be executed once every day from 12:18 to 0:00. Actual: It will be executed every 1 minute from 12 am to 18 am every day. Reason: The first place is*. Correct expression:0 12-18 * * ** 12-18 * * *Reasons for listing: classic demonstration by group friends, collective blindness series
0 18-12 * * *Ideal: It will be executed once every day from 18:00 to 12:00 the next day at the 0 minute. Actual: Unable to execute. Reason: The time scale cannot be crossed. Correct expression:0 18-23,0-12 * * **/90 * * * * *Ideal: it will be executed every 90 seconds. Actual: It is executed every 60 seconds. Reason:Secondis only60, when it is greater than60, it will be calculated as60. Correct expression: currently unable to do it, recommend the curve to save the country
