Linux的crontab(Cron Table)支持的時間格式為:
* * * * * command-to-be-executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday is both 0 and 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)
每個字段的取值范圍如下:
注意:在某些情況下,某些字段可能受到限制,例如一個月中的天數可能會因為月份而改變,或者在某些特殊日期(如閏年的2月29日)可能不存在。因此,在設置crontab定時任務時,請確保指定的時間格式符合您的實際需求。