Cronexpression to exclude hours of a specific day
Asked Answered
M

1

6

Is it possible to create a CronExpression with: "fire every day every 20min but not on Saturday between 10:00 and 14:00"?

Something like "0 0/20 * ? * MON-SAT" is clear, but it is not the same...

Mauriciomaurie answered 30/5, 2012 at 8:29 Comment(0)
S
8

You will have to use two expressions; One for saturdays, one for all other days:

0 0/20 * * * SUN-FRI     command
0 0/20 0-9,14-23 * * SAT command
Slier answered 30/5, 2012 at 8:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.