Cron expression for a time range

后端 未结 3 1617
忘了有多久
忘了有多久 2020-12-11 08:19

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

3条回答
  •  余生分开走
    2020-12-11 08:29

    Regarding cron seconds support, there appears to be some difference in the syntax used between the UNIX cron tool and CRON Expression Wikipedia articles. According to the Quartz CRON Documentation however, seconds is supported.

    Given the above, I would create three CRON Triggers to handle:

    1. 2:15:00 - 2:59:59
    2. 3:00:00 - 4:59:59
    3. 5:00:00 - 5:19:59

    Which would translate to (I believe):

    1. * 15/1 2 * * ?
    2. * * 3-5 * * ?
    3. * 0-20 5 * * ?

提交回复
热议问题