如何在9月1日工作日创建一个cronexprrssion。这意味着省略星期天
答案 0 :(得分:2)
基于格式:
+---------------- 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
这应该成功:
+---------------- 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
答案 1 :(得分:1)
如果你想要@Duncan所说的(一个cron表达式找到九月的第一个工作日),那么应该这样做:
0 0 0 1W 9 ? *
结果: