トップページ | 過去記事(月別カテゴリー別) | 掲示板 | 野良DEB,RPM | 更新チェック | Twitter
<<  2012.9  >>
SMTWTFS
      1
2345678
9101112131415
16171819202122
23242526272829
30      
 
リンク
その他
  • RSS2.0
  • Credit

  • SEO
    loading

    プライバシーポリシー
    Google

カテゴリー » Linux September 19, 2012

rtcwake - 指定時間になったらスリープ/休止状態/電源OFFから自動的に復帰 Linux

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)
12:18 am | コメントする |

上の記事に対するコメント

1. komori  2012/09/19 10:16
おお、これは便利ですね。
ありがたく使わせて頂きます。

うちは電気契約が季時別電灯なので、
電気代の高い時間帯だけスリープにさせてみます。

2. Owner CommentSawa  2012/09/20 21:31
なぜか日本ではほぼ無名なんですよね。 > rtcwakeコマンド
検索してみると、/sys/class/rtc/rtc0/wakealarm を自分でいじって設定している人ばっかり。

3. thankyou!  2014/02/26 12:23
旧めのマシンにLinux mint 16をインストールして勉強している初心者です。
GV/MVP-RX2を使ってテレビ視聴&録画ができるまでたどり着いたのですが、
サスペンドなどができず困っていました。
私もネットで調べた情報から/sys/class/rtc/rtc0/wakealarmを
いじっていましたがダメでした。
でもrtcコマンドは難なく成功です♪
助かりました&勉強になりました☆
貴重なアドバイスありがとうございます!

コメントをどうぞ。名前とURLはオプションです。

Comment Form
NAME:
URL:
文字色:  

累計:2803150、今日:76、昨日:858
Created in 0.0091 sec.