rtcwakeというコマンドを知った今日この頃です。
$ man rtcwake
NAME
rtcwake - enter a system sleep state until specified wakeup time
...
-l | --local
Assumes that the hardware clock is set to local time,
regardless of the contents of /etc/adjtime.
...
-s seconds | --seconds seconds
Sets the wakeup time to seconds in future from now. -t time_t | --time time_t
Sets the wakeup time to the absolute time time_t. time_t is the time
in seconds since 1970-01-01, 00:00 UTC. Use the date(1) tool to
convert between human-readable time and time_t.
-m mode | --mode mode
Use standby state mode. Valid values are: standby
ACPI state S1. This state offers minimal, though real, power savings,
while providing a very low-latency transition back to a working system.
This is the default mode.
mem
ACPI state S3 (Suspend-to-RAM). This state offers significant power
savings as everything in the system is put into a low-power state,
except for memory, which is placed in self-refresh mode to retain
its contents. disk
ACPI state S4 (Suspend-to-disk). This state offers the greatest power
savings, and can be used even in the absence of low-level platform support
for power management. This state operates similarly to Suspend-to-RAM,
but includes a final step of writing memory contents to disk.
off
ACPI state S5 (Poweroff). This is done by calling '/sbin/shutdown'.
Not officially supported by ACPI, but usually working. no
Don't suspend. The rtcwake command sets RTC wakeup time only.
...
「-m mem」を指定するとスリープ(サスペンド)、「-m disk」だと休止状態(ハイバネート)、「-m off」は電源オフになるのだと思います。
例えば、一時間だけスリープしたいときは
$ sudo rtcwake -m mem -s 3600
復帰までの時間を時刻で指定したいなら
$ sudo rtcwake -m mem -l -t $(date +%s -d "2012-09-18 23:00")
サーバー機で使うと便利かもしれません。
ちなみに、rtcwakeを利用せずに直接 /sys/class/rtc/rtc0/wakealarm で設定してもいいらしい。
→
遙かデジタリアへ: Linuxマシンをタイマーで自動起動させるには(ACPI wakeup)
上の記事に対するコメントです
1. komori 2012/09/19 10:16
ありがたく使わせて頂きます。
うちは電気契約が季時別電灯なので、
電気代の高い時間帯だけスリープにさせてみます。
2.
Sawa 2012/09/20 21:31
検索してみると、/sys/class/rtc/rtc0/wakealarm を自分でいじって設定している人ばっかり。
3. thankyou! 2014/02/26 12:23
GV/MVP-RX2を使ってテレビ視聴&録画ができるまでたどり着いたのですが、
サスペンドなどができず困っていました。
私もネットで調べた情報から/sys/class/rtc/rtc0/wakealarmを
いじっていましたがダメでした。
でもrtcコマンドは難なく成功です♪
助かりました&勉強になりました☆
貴重なアドバイスありがとうございます!