centos 定时任务相关命令

启动、关闭、重启

# 启动
systemctl start crond
# 关闭
systemctl stop crond
# 重启
systemctl restart crond
# 开机自启动
systemctl enable crond
# 状态
systemctl start crond

配置定时规则

# 修改配置文件
vim /etc/crontab
# 保存生效
crontab /etc/crontab
# 查看任务
crontab -l

日志查看

# 查看系统日志目录下的定时任务日志
tail -99f /var/log/cron
# 查看当前用户mail
tail -99f /var/spool/mail/root

版权声明:
作者:白纸画
链接:https://www.fanyicloud.cn/article-58.fan
来源:白纸画的博客
文章版权归作者所有,未经允许请勿转载。

THE END
二维码
打赏
< <上一篇
下一篇>>