时间范围的 Cron 表达式 [英] Cron expression for a time range
问题描述
我正在使用 Quartz.Net 在我的应用程序中安排我的工作.我只是想知道是否可以为以下场景构建 CRON 表达式:
<块引用>凌晨 2:15 到 5:20 之间的每一秒
关于 cron 秒支持,UNIX cron 工具 和 CRON 表达式.但是,根据 Quartz CRON 文档,支持秒数.>
鉴于上述情况,我将创建三个 CRON 触发器来处理:
- 2:15:00 - 2:59:59
- 3:00:00 - 4:59:59
- 5:00:00 - 5:19:59
这会转化为(我相信):
* 15/1 2 * * ?
* * 3-5 * * ?
* 0-20 5 * * ?
I am using Quartz.Net to schedule my jobs in my application. I was just wondering if a CRON expression for the following scenario can be built:
Every second between 2:15AM and 5:20AM
Regarding cron seconds support, there appears to be some difference in the syntax used between the UNIX cron tool and CRON Expression. According to the Quartz CRON Documentation however, seconds is supported.
Given the above, I would create three CRON Triggers to handle:
- 2:15:00 - 2:59:59
- 3:00:00 - 4:59:59
- 5:00:00 - 5:19:59
Which would translate to (I believe):
* 15/1 2 * * ?
* * 3-5 * * ?
* 0-20 5 * * ?
这篇关于时间范围的 Cron 表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!