> crontab -e
0 3 * * * /sbin/reboot

设置凌晨 3 点重启服务器,但未生效

原因是 crontab 程序需重启

> /etc/init.d/crond restart

CentOS 7 使用

service crond restart
systemctl restart crond

以下为测试:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注