在VirtualBox里的CentOS虚拟机设置定时关机,可以通过以下几种方法实现:
shutdown
命令shutdown -h now
shutdown -h 分钟数
(例如:shutdown -h 10
表示10分钟后关机)shutdown -h YYYY-MM-DD HH:MM
(例如:shutdown -h 2025-06-10 18:00
表示当天18:00关机)。crontab
设置定时关机crontab -e
编辑 /etc/crontab
文件。0 20 * * * root shutdown -h now
0 22 * * * root shutdown -h now
0 23 * * * root shutdown -h now
。以上就是在VirtualBox中的CentOS虚拟机上设置定时关机的方法,你可以根据自己的需求选择合适的方式。