了解最新动态和产品更新
获取帮助文档和使用指南
使用 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