Reputation: 307
I am looking for the following schedule using CRON Expressions
Runs every hour from 9 AM to 5 PM => "schedule": "0 0 9-17 * * *" => working
Runs every 2 hours from 9 AM to 5 PM => "schedule": "0 0/120 9-17 * * *" => not working
The format per hour is (0-23) hence it is not recognizing.
How I can achieve the following then? Runs every 2 hours from 9 AM to 5 PM
https://github.com/atifaziz/NCrontab
Upvotes: 0
Views: 510
Reputation: 21848
Alternative solutions.
0 0 9,11,13,15,17 * * *
Because the requirements are not complicated, you can list the time to be executed one by one.
Each field has a range, so your second one is not feasible.
Upvotes: 2