In crontab I can set this syntax 5 4 * * 3-5

Which translates to every Wednesday, Thursday and Friday at 4:05, which works well, but when using 5-3 which (expected) translates to Friday, Saturday...Wednesday, it says wrong syntax, I noticed it should be in order, but what if I need it the other way?

I use this to test cron syntax.


one way is

5 4 * * 0-3,5-7 script
  • 0 and 7 are sunday

another way

5 4 * * 0,1,2,3,5,6 script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.