shell与crontab定时器的结合
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
每分钟(10:01,10:02 ...)
* * * * * 或 */1 * * * *
每小时
0 * * * *
每天
0 0 * * *
每周
0 0 * * 0
每月
0 0 1 * *
每年
0 0 1 1 *
每天早上6点
0 6 * * *
每2小时
0 */2 * * *
每小时10分,40分
10,40 * * * *
每天下午4,5,6点的 1,2,3,4,5min
1,2,3,4,5 16,17,18 * * *echo "hello world " >> /var/test.logs1.查看当前任务列表
crontab -l
2.进入crontab编辑界面
crontab -e
3.末尾加入
* * * * * sh test.sh的绝对路径