生成cron表达两年

时间:2017-10-31 10:20:15

标签: cron

我需要在2017年10月到2018年2月的日期范围内每10分钟生成一次cron表达式。

我尝试了以下表达式:

 0 10 0 ? 10-2 * 2017-2018, 

但它不是一个有效的表达。我收到此错误消息:

  

((月) - 范围不支持的值'10 -2'。),

请帮忙。

1 个答案:

答案 0 :(得分:1)

尝试使用它:

*/10 * * 2-10 * 2017,2018 command here

来自nncron.ru页面:

* * * * * *
| | | | | | 
| | | | | +-- Year              (range: 1900-3000)
| | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)

如果您想测试其他格式,请使用此页面http://cronsandbox.com/

相关问题