cron表达式0 1-59/5 8-20 * * *
时间: 2024-07-15 08:01:19 浏览: 131
cron 表达式是一个用于安排在特定时间执行任务的标准格式,"0 1-59/5 8-20 * * *" 这是一个典型的cron表达式,它的各个部分分别代表:
1. **秒** (0): 指定在分钟内的具体时刻,这里是0秒(即每分钟开始的时候)。
2. **分钟** (1-59/5): 表示从1到59之间,但是每隔5分钟执行一次。`/5`表示步长为5,所以实际执行的是1,6,11,...,55分钟。
3. **小时** (8-20): 在一天中的8点至20点之间运行任务。
4. **月份** (*): 使用星号(*)代表所有月份,这意味着每个月都会执行。
5. **星期** (*): 星期*也代表每周每一天,表示每天都在执行。
6. **年份** (*): 同样地,年份(*)表示每年的所有日期。
综上所述,这个cron表达式的含义是在每天的8点、13点(1点加5*6=30分钟),以及18点和19点,每隔5分钟执行一次任务,直到20点结束。如果某个任务设置了这样的cron规则,那么它会在这些时间段内按照指定的时间间隔重复执行。
相关问题
cron表达式 0-29 0/1 * * * ? 是什么意思
这是一个cron表达式,用于表示定时任务的执行时间。它的含义是:
在每小时的0分开始,每隔1分钟执行一次,直到29分结束。
下面是各个字段的含义:
- 第1个字段(秒):表示分钟内的秒数,取值范围为0~59。
- 第2个字段(分):表示小时内的分钟数,取值范围为0~59。
- 第3个字段(小时):表示一天内的小时数,取值范围为0~23。
- 第4个字段(日):表示一个月内的日期数,取值范围为1~31。
- 第5个字段(月):表示一年内的月份,取值范围为1~12。
- 第6个字段(周):表示一周内的星期数,取值范围为1~7,其中1表示星期日,2表示星期一,以此类推。
- 第7个字段(年):表示年份,可以省略不写。
在这个cron表达式中,第1个字段秒被省略,第7个字段年也被省略,表示每年都要执行这个定时任务。
cron 表达式 */3 0/3 7-23,0-1 * * *表示什么意思 详细
解答如下:
这是一个用于定时任务的 Cron 表达式,其中包含了 6 个字段,分别代表秒、分、时、日、月、周几。具体解释如下:
1. 第一个字段:秒(0~59)。
2. 第二个字段:分(0~59)。
3. 第三个字段:时(0~23)。
4. 第四个字段:日(1~31)。
5. 第五个字段:月(1~12)。
6. 第六个字段:周几(0~6),其中 0 表示周日,1 表示周一,以此类推。
*/3 表示“每隔 3 个”,所以 */3 在第一个字段中表示“每隔 3 秒执行一次”。
0/3 表示“从第 0 秒开始,每隔 3 秒执行一次”,所以 0/3 在第二个字段中表示“从第 0 分钟开始,每隔 3 分钟执行一次”。
7-23,0-1 表示“7 点到 23 点以及 0 点到 1 点”,所以 7-23,0-1 在第三个字段中表示“从 7 点到 23 点以及 0 点到 1 点,每隔 3 分钟执行一次”。
最后,* 表示“任意”,所以星号在其他字段中表示“任意值”。
因此,该 Cron 表达式的含义是在每天的 7 点到 23 点以及 0 点到 1 点之间,每隔 3 分钟执行一次。
阅读全文
相关推荐
















