星期五, 五月 15, 2009

Crontab注意事项

m h dom mon dow分别代表了:
# m------------ minute (0 - 59)
# h------------ hour (0 - 23)
# dom------------day of month (1 - 31)
# mon----------- month (1 - 12) OR jan,feb,mar,apr ...
# dow------------ day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
#
# * * * * * command to be executed
时间调度表格















































EntryDescriptionEquivalent To
@rebootRun once, at startup.None
@yearlyRun once a year0 0 1 1 *
@annually(same as @yearly)0 0 1 1 *
@monthlyRun once a month0 0 1 * *
@weeklyRun once a week0 0 * * 0
@dailyRun once a day0 0 * * *
@midnight(same as @daily)0 0 * * *
@hourlyRun once an hour0 * * * *

在crontab中直接执行二进制命令,需要在后面添加>/dev/null 2>&1

没有评论: