linux定时任务-Crontab&Crond

说明:crontab管理Crond(具体说明可以使用man crontab)

创建定时任务:

//进入定时任务编辑状态
crontab -e 
//在每天21:30执行logzip.sh脚本
30 21 * * * /root/20190523/logzip.sh 
//前边时间参数说明
1号位:分钟
2号位:小时
3号位:日期
4号位:月份
5号位:星期

启停定时任务等:

service crond start //启动服务
service crond stop //关闭服务
service crond restart //重启服务
service crond reload //重新载入配置

查看定时任务状态:

service crond status //查看crontab服务状态
crontab -l //查看系统全部定时任务
crontab -r //删除定时任务

 

参考:

https://www.cnblogs.com/phpstudy2015-6/p/7534968.html

http://www.cnblogs.com/wt645631686/p/6868672.html

crond执行日志可以查看/var/log/cron,但是我查询的时候没有找到执行日志不知道为什么。。。

参考:https://www.cnblogs.com/doseoer/p/5663187.html

posted @ 2019-05-23 22:00  杏仁拌饭  阅读(63)  评论(0)    收藏  举报