Reputation: 3
How to create a cronexprrssion for ever 1st September working day. It means omit Sunday
Upvotes: 0
Views: 1662
Reputation: 290025
Based on the format:
+---------------- minute (0 - 59)
| +------------- hour (0 - 23)
| | +---------- day of month (1 - 31)
| | | +------- month (1 - 12)
| | | | +---- day of week (0 - 6) (Sunday=0 or 7)
| | | | |
* * * * * command to be executed
This should make it:
+---------------- at minute 0
| +------------- at hour 0
| | +---------- at day 1
| | | +------- at month 9 -> September
| | | | +---- at day 1 to 6, that is, all but Sunday
| | | | |
0 0 1 9 1-6 /your/path/ /your/script
Upvotes: 2
Reputation: 264
If you want what @Duncan said (a cron expression that finds the first working day in September), then this should do:
0 0 0 1W 9 ? *
Results:
Upvotes: 1