1.编辑配置
vi /etc/crontab
2.设置重启时间
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
20 04 * * * root reboot #04:20 每天凌晨4点20分重启系统
*/10 * * * * root reboot #10分钟重启一次
*/4 * * * root reboot #隔4个小时重启一次
3.装载
crontab /etc/crontab
4.重启定时服务
systemctl enable crond.service #开启启动
systemctl restart crond.service #重启服务
5.查看定时配置
crontab -l
查看系统重启情况(常用方法):
last reboot
who -b
评论前必须登录!
注册