rtcwake is a built-in kernel utility that allows, using a RTC (Real Time Clock) framework driver that supports standard driver model wakeup flags. rtcwake is a command line utility, so can easily script your usage models, including cron (scheduled jobs). To know a little more about the utility, you may want to read the man page.
Using rtcwake is fairly simple. For example, to just dispatch your machine to sleep right now wake it up in a few moments:
rtcwake -m mem -s 180
What do we have here? -m flag specifies the mode - standby, suspend to RAM, suspend to disk (hibernate), and powered on. -s flag tells us how much time we want our machine to sleep (in seconds).
This is a trivial example that will sleep my machine for three minutes and then wake it up. Tested and works very reliably. I could have taken a video of my box coming back to life, but I hope you trust my word.
Other things
Lastly, you can tweak your machine sleep and wake using BIOS, if it supports those. Likewise, you can work with the acpitool to query and set your ACPI values. acpitool can also allow the machine to be put into standby, toggle LCD brightness level, set fan speeds, etc. Lastly, on older kernels, instead of rtcwake, you will want to use the apmsleep tool.
No comments:
Post a Comment