Crontab是定时任务需要的程序,Debian和Centos的安装方式不一样,现在做下笔记。
1、判断是否安装
直接在shell里输入crontab
,如果有显示帮助,则说明安装了。
2、安装
运行
yum -y install vixie-cron
yum -y install crontabs
安装后执行
systemctl start crond.service #启动程序
systemctl enable crond.service #设置开机启动
3、管理
启动:
systemctl start crond.service
停止:
systemctl stop crond.service
重启:
systemctl restart crond.service
开机运行:
systemctl enable crond.service