Cronexpression to exclude hours of a specific day

5k Views Asked by At

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...

1

There are 1 best solutions below

0
On

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