所以我谷歌了一下,但就是不明白最后一部分。问题如下。如果 cron 如下,结果会怎样:
0 2 12 * 0,6 /usr/bin/test
0,6
因为那应该是年份,所以我对最后一部分感到困惑吗?
答案1
最后一部分是星期几。因此 0.6 表示星期日和星期六。
答案2
不,那是星期几字段。来自man 5 crontab
Commands are executed by cron(8) when the minute, hour, and month of
year fields match the current time, and when at least one of the two
day fields (day of month, or day of week) match the current time (see
``Note'' below). cron(8) examines cron entries once every minute. The
time and date fields are:
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sun, or use names)