Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Tuesday, December 28, 2010

Wake up for a...

Cron Job
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: