安装crontab
yum install crontabs
centOS:
使用crontab -e //编辑
crontab -l //查看定时任务
生效运行:
先安装;
systemctl enable crond
systemctl start crond
停止:systemclt stop crond
服务操作说明:
service crond start ## 启动服务
service crond stop ## 关闭服务
service crond restart ## 重启服务
service crond reload ## 重新载入配置
service crond status ## 查看crontab服务状态:
列出某个用户cron服务的详细内容
crontab -l 列出某个用户cron服务的详细内容
## 手动启动crontab服务:
service crond start
## 查看crontab服务是否已设置为开机启动,执行命令:
chkconfig --list
## 加入开机自动启动:
chkconfig --level 35 crond on