日期:2014-05-16  浏览次数:20680 次

Linux自动关机设置

vi /etc/crontab

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

# run-parts

01 * * * * root run-parts /etc/cron.hourly

02 4 * * * root run-parts /etc/cron.daily

22 4 * * 0 root run-parts /etc/cron.weekly

42 4 1 * * root run-parts /etc/cron.monthly

下面添一行

58 16 * * * root init 0 //每天16:58自动关机
?

重启crond任务

?

/sbin/service crond start //启动服务

/sbin/service crond stop //关闭服务

/sbin/service crond restart //重启服务

/sbin/service crond reload //重新载入配置

转自:http://hi.baidu.com/alert2008/blog/item/e9fbf138b05466f43a87cee1.html