アプリ版:「スタンプのみでお礼する」機能のリリースについて

cron設定で電源のOFFができません。

cent OS 5.5 で自宅サーバーを立上げ勉強中です。

サーバーの電源を自動で18:00にONにして翌日の7:00にOFFにしたいと思います。
いろいろなホームページを参考にさせていただき、電源のONはパソコンのBIOS設定、OFFは"cron"を使うことできることがわかりました。

電源のONはパソコンのBIOS設定でできましたが、OFFができません。

設定は以下としています。

[root@Linux ~]# vi /etc/crontab
CSHELL=/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

0 7 * * * shutdown -h now #追加


[root@Linux ~]# /etc/rc.d/init.d/crond restart

[root@Linux ~]#chkconfig crond on

[root@Linux ~]# chkconfig --list crond
crond 0:off1:off2:on3:on4:on5:on6:off

[root@Linux ~]# /etc/rc.d/init.d/crond status
crond (pid xxx) を実行中...


設定時間になっても電源がOFFになりません。


[root@Linux ~]# shutdown -h now ではOFFにできます。

(cent OS 5.5 をインストールしているパソコンは 富士通 FMV DESKPOWER CE18B 2002
年製です)


よろしくお願いします。

A 回答 (1件)

> 0 7 * * * shutdown -h now #追加



他のエントリと比べて見てください。
実行ユーザの root が抜けていますよ。
    • good
    • 0
この回答へのお礼

このファイルは 分 時 日 月 曜日 ユーザ コマンド と7つのフィールドで形成されているのですね。
0 7 * * * root shutdown -h now で電源の自動OFFができました。

ありがとうございました。

お礼日時:2010/06/27 16:10

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!