一、指令
shutdown命令
shutdown -h now //立即关机
shutdown -h 2 //分钟后关机
shutdown -r now //立即重启
shutdown -r 1 //1分钟后重启
sleep 30s //等待30秒来后面也可以运行程序
halt // 关机
reboot // 重启
sync // 把内存的数据同步到磁盘,一般定时关机或者重启都要加这个指令放置信息丢失
init 0 //关机
init 6 //重启
二、定时关机脚本
定时重启脚本
sync
sleep 20s
reboot