I understand that crontab expression doesn't have the 'Year' expression. But I would like to know, if there is a workaround or something which can enable the Hangfire to start/stop scheduling at a specified Year.
For example, given a case:
Assume current date is 2016, September 15
Scheduler Starts on 2016, December, 1
Repeat every hour from 8.30am till 5.30pm daily (office hour)
Happens on weekday Monday-Friday
End on 2018, Februrary, 1
Understood from other post that, it may require more than 1 crontab expression in some cases. But for this one, i have no idea how to write. Reason:
if i write:
- "30 8 1 12 0-4": it only specifies December 1
- "30 8 * * 0-4": it doesn't tell which month to start or end
How to write this crontab?
Not sure of a clean way. But it could be handled in this manner- 5 jobs:
2 Delayed Jobs to run on Start Date and End Date(StartDateDelayedJob, EndDateDelayedJob)
3 Recurring Jobs -
StartDateDelayedJob will add 2nd Recurrence Job and 3rd Recurrence Job.
EndDateDelayedJob will remove the two Recurrence Jobs.
Hope this helps