shutdownコマンド
個人PCでの利用は halt コマンドで終了したほうが効率よいけど、将来を見据えて shutdown コマンドを理解しなおす。
shutdownコマンド
# shutdown [オプション] [時間] [メッセージ]
オプション
オプション | 説明 |
---|---|
-h | シャットダウン終了後にシステムを停止。halt |
-r | シャットダウン終了後にシステムを再起動。reboot |
-f | -h,-r の組み合わせ。次回起動時に fsck を実行しない。 |
-F | -h,-r の組み合わせ。次回起動時に fsck を必ず実行する。 |
-k | シャットダウンはせずに、警告メッセージをログインユーザへ送る。 |
-c | シャットダウンをキャンセルする。 |
時間
設定例 | 説明 |
---|---|
+5 | 5分後に実行 |
now | 直ちに実行、+0でも同じ |
3:00 | 午前3時に実行(すでに過ぎている場合は翌日) |
メッセージ
文字通りメッセージ。ログイン中のユーザへ注意を促す。
- 例
# shutdown -k +0 hello Broadcast message from root (tty1) (Sat Jul 2 23:59:59 2010): hello The system going down to maintenance mode NOW! Shutdown cancelled. #