0 18 * * * command to be executed
^ you need to set the minute, too. Else it would be running every minute on the 18th hour
一般如何设置 cronjob:
# * * * * * command to execute
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
# │ │ │ └────────── month (1 - 12)
# │ │ └─────────────── day of month (1 - 31)
# │ └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)
星号 (*) 是什么意思
星号表示 cron 表达式匹配该字段的所有值。例如,在第 4 个字段(月)中使用星号表示每个月。
旁注
cronjobs 中的其他特殊字符
斜线(/)
斜线描述范围的增量。例如,第一个字段(分钟)中的 3-59/15 表示一小时的第三分钟,之后每隔 15 分钟。 “*/...”形式等价于“first-last/...”形式,即在字段的最大可能范围内递增。
逗号 (, )
逗号用于分隔列表中的项目。例如,在第 5 个字段(星期几)中使用“MON,WED,FRI”表示星期一、星期三和星期五。
连字符 (-)
连字符定义范围。例如,2000-2010 表示从公元 2000 年到 2010 年之间的每一年(含)。
百分比(%)
命令中的百分号 (%),除非用反斜杠 () 转义,否则将更改为换行符,并且第一个 % 之后的所有数据都作为标准输入发送到命令。
(来源:https://en.wikipedia.org/wiki/Cron)