使用 systemd 设置定时重启
sudo touch /etc/systemd/system/reboot.service
[Unit]Description=Reboot Service[Service]Type=oneshotExecStart=/sbin/reboot[Install]WantedBy=multi-user.target
sudo touch /etc/systemd/system/reboot.timer
[Unit]Description=Reboot Timer[Timer]OnCalendar=*-*-* 02:30:00[Install]WantedBy=timers.target
sudo systemctl enable --now reboot.timer
这样就可以在每天早上 2:30 重启了。
使用 cron 设置定时重启
crontab -e
30 2 * * * /sbin/reboot
Copyright ? 2013-2024 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号 粤公网安备 44200002445359号
增值电信业务经营许可证编号:B1-20222012
代理域名注册服务机构:西部数码