【发布时间】:2016-03-09 05:41:50
【问题描述】:
我想设置一个 cron 任务以在每个月的第一天运行一个脚本,除了 1 月 1 日。我该怎么做?
我可以试试这样的:0 0 1 2-12 * 吗?
【问题讨论】:
标签: cron crontab cron-task cronexpression
我想设置一个 cron 任务以在每个月的第一天运行一个脚本,除了 1 月 1 日。我该怎么做?
我可以试试这样的:0 0 1 2-12 * 吗?
【问题讨论】:
标签: cron crontab cron-task cronexpression
可能是这样的:
0 0 1 2,3,4,5,6,7,8,9,10,11,12 *
【讨论】:
Minutes [0-59]
| Hours [0-23]
| | Days [1-31]
| | | Months [1-12]
| | | | Days of the Week [Numeric, 0-6]
| | | | |
* * * * * home/path/to/command/the_command.sh
这对您识别用途很有用。
【讨论】: