我需要在格林威治标准时间下午 6 点到早上 7 点之间通过每周 5 天(周一至周五)的 cron 表达式执行脚本。
请告知这将是什么 cron 表达式..
我试过这个...
0 00 23 ? * MON-FRI
因为格式如下:
+---------------- 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
你可能希望它是:
* 6 * * 1-5 command
这将从 6.00 到 6.59 每分钟工作一次。如果您还需要它在 7.00 执行:
* 6 * * 1-5 command
0 7 * * 1-5 command
如果你想从 6.00 到 7.59,每分钟:
* 6-7 * * 1-5 command