crontab 年月日定时任务的另类方法

NOCO发布于 分类 Linux

11天前 有1个用户阅读过

crontab 定时任务的常见方法

### 格式:    minute  hour    dayofmonth   month    dayofweek    command
### 解释:    分钟    小时    日期         月       周           命令
### 范围:    0-59    0~23   1~31        1~12    0~7,0和7都代表周日

### 每天00:00更新时间
0 0 * * * /usr/sbin/ntpdate time.nist.gov >/dev/null 2>&1 

之前为了年月日的定时任务没少做加减法,而且还特别小心。

crontab 年月日定时任务的另类方法

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 * * * *". 

-- The End --

本文标题: crontab 年月日定时任务的另类方法

本文地址: https://seonoco.com/blog/crontab-skills

本文是否有所帮助?
点赞 0
感谢支持
0
多谢反馈
评论 0
打赏

支持微信/支付宝

评论

网友