cronjob schedular 使用的一般语法是:
# Execute the <b>command</b> every minute of every day.
* * * * * command
cronjob schedular 使用的所有字段说明:
# field # meaning allowed values
# ------- ------------ --------------
# 1 minute 0-59
# 2 hour 0-23
# 3 day of month 1-31
# 4 month 1-12 (or names, see below)
# 5 day of week 0-7 (0 or 7 is Sun, or use names)
可以使用八个特殊字符串之一来代替前五个字段:
string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".
在使用间隔 / 后重复工作:
*/15 * * * * command
# This will execute the command after every 15 minutes.
为了在特定时间执行作业,可以使用“,”:
* 2,20 * * * command
# This will execute the job every minute but at the hours 2 AM and 8 PM.
希望能消除您的疑虑。