当前位置:网站首页>Corn expression usage
Corn expression usage
2022-07-21 20:06:00 【adadapter】
sketch
Cron An expression is a string with time meaning , String to 5~6 Space between , It is divided into 6~7 Domains , The format is X X X X X X
. among X
Is a placeholder for a field . The last field representing the year is not required , It can be omitted . When a single field has multiple values , Use half angle commas , Interval value . Each field can be a definite value , It can also be a special character with logical meaning , Each domain supports at most one leading zero . for example
Appoint 2022 Every morning in 8:15 Perform tasks ,Cron The expression can be specified as `0 15 8 ? * * 2022` perhaps
`0 15 08 ? * * 2022`, But it cannot be specified as `0 15 008 ? * * 2022`
Field value and character usage
Domain | Is it necessary to | Value range | Special characters |
---|---|---|---|
second | yes | [0, 59] | * , - / |
minute | yes | [0, 59] | * , - / |
Hours | yes | [0, 23] | * , - / |
date | yes | [1, 31] | * , - / ? L W |
month | yes | [1, 12] or [JAN, DEC] | * , - / |
week | yes | [1, 7] or [MON, SUN]. If you are using [1, 7] The way of expression ,1 On behalf of Monday ,7 On behalf of Sunday . | * , - / ? L # |
year | no | [ Current year ,2099] | * , - / |
Usage examples
Example | explain |
---|---|
0 15 10 ? * * | Every morning 10:15 Perform tasks |
0 15 10 * * ? | Every morning 10:15 Perform tasks |
0 0 12 * * ? | Every day at noon 12:00 Perform tasks |
0 0 10,14,16 * * ? | Every morning 10:00 spot 、 Afternoon 14:00 And in the afternoon 16:00 Perform tasks |
0 0/30 9-17 * * ? | Every morning 09:00 In the afternoon 17:00 Perform the task every half an hour during the time period |
0 * 14 * * ? | Every afternoon 14:00 In the afternoon 14:59 Every 1 Minutes to perform the task |
0 0-5 14 * * ? | Every afternoon 14:00 In the afternoon 14:05 Every 1 Minutes to perform the task |
0 0/5 14 * * ? | Every afternoon 14:00 In the afternoon 14:55 Every 5 Minutes to perform the task |
0 0/5 14,18 * * ? | Every afternoon 14:00 In the afternoon 14:55、 Afternoon 18:00 In the afternoon 18:55 Every 5 Minutes to perform the task |
0 0 12 ? * WED | Every Wednesday at noon 12:00 Perform tasks |
0 15 10 15 * ? | monthly 15 The morning of 10:15 Perform tasks |
0 15 10 L * ? | On the morning of the last day of each month 10:15 Perform tasks |
0 15 10 ? * 6L | On the morning of the last Saturday of each month 10:15 Perform tasks |
0 15 10 ? * 6#3 | On the morning of the third Saturday of each month 10:15 Perform tasks |
0 10,44 14 ? 3 WED | Every year, 3 Every Wednesday afternoon of the month 14:10 and 14:44 Perform tasks |
0 15 10 ? * * 2022 | 2022 Every morning in 10:15 Perform tasks |
0 15 10 ? * * * | Every morning every year 10:15 Perform tasks |
0 0/5 14,18 * * ? 2022 | 2022 Every afternoon in 14:00 In the afternoon 14:55、 Afternoon 18:00 In the afternoon 18:55 Every 5 Minutes to perform the task |
0 15 10 ? * 6#3 2022,2023 | 2022 - 2023 On the morning of the third Saturday of each month 10:15 Perform tasks |
0 0/30 9-17 * * ? 2022-2025 | 2022 - 2025 Every morning in 09:00 In the afternoon 17:30 Perform the task every half an hour during the time period |
0 10,44 14 ? 3 WED 2022/2 | from 2022 Year begins , Every two years 3 Every Wednesday afternoon of the month 14:10 and 14:44 Perform tasks |
边栏推荐
- 京东爆款架构师成长手册首发,架构师光环你也值得拥有
- Flutter obtains longitude and latitude through geolocator positioning plug-in and calls Gaode peripheral information interface
- jimu积木报表打印时多一页空白页-问题解决
- STM32 - ADC reads the photosensitive sensor, controls the LED light, and the watchdog interrupts
- 868. 筛质数
- 2022.7.18DAY609
- Wechat official account development access, using wechat public platform to apply for test number for local development
- STM32 - general timer control ultrasonic sensor hcsr04
- 图表即代码:以代码化的方式构建新一代图形库 —— Feakin
- C -- compilation preprocessing
猜你喜欢
数据类型Map判空 、空字符串、空key值等各种判断方法,全网最详细
微信公众号开发接入,利用微信公众平台申请测试号进行本地开发
Jd.com's popular architect growth manual is launched, and you deserve the architect aura
逐步理解深度信念网络
(4) Transactions
Gaode map API obtains the surrounding information corresponding to the current location
自动抓包工具 web scraper
How to choose sentinel vs. hystrix current limiting?
One of the problems to solve the sorting order error of Oracle database query single table
QT notes - qmetaenum class
随机推荐
【To .NET】. Net core web API development process knowledge points sorting [getting started]
From March to June, after summary, more than 200 pages of true question notes and detailed explanations (including core test sites and 6 major factories)
Uniapp develops apps to solve uni Pagescrollto does not take effect
STL list merge
Lst list deletion and modification
ES6 related interview questions
Quartz创建定时任务(入门)
Iwemeta: Shi Yuzhu's golden sauce wine: OEM factories have been shut down. Who is producing it?
Error in pulling project POM file, Jai_ core-1.1.3. Jar, solve the problem of introducing jar
Share pictures or link to Tiktok
如何确定你访问的网站的真实性——证书体系
Written test compulsory training day 18
Project debug|no string argument constructor / factory method to deserialize from string val
Download Yotube videos using clip converter website
Incomplete access to wechat database handle
2022DASCTF MAY web
微信公众号开发接入,利用微信公众平台申请测试号进行本地开发
10行代码实现微信小程序支付功能,使用小程序云开发实现小程序支付功能(含源码
MySQL之数据库设计三范式
Chart is code: build a new generation of graphics library in a coded way -- feekin