Skip to content

VPS上设定每天上午4点自动重启

Tags:

修改crontab (先设置正确的时区)

# 修改时区
timedatectl set-timezone Asia/Shanghai

# 如果改不了,可能是时区表有问题,列出所有的可用时区
timedatectl list-timezones 

# 如果只显示UTC, 则设定时区
sudo dpkg-reconfigure tzdata

crontab -e
# m h  dom mon dow   command
# add the following line to reboot at 4am
0  4 * * * /sbin/reboot

Leave a Reply

Your email address will not be published.