How can I hibernate or sleep my Ubuntu 10.10 desktop and have it "wake up" the next day?
I have seen software that can do this on windows, so it can't be hard on Ubuntu!
How can I hibernate or sleep my Ubuntu 10.10 desktop and have it "wake up" the next day?
I have seen software that can do this on windows, so it can't be hard on Ubuntu!
rtcwake
The command that you are interested in is
rtcwake
:testing
To find the correct syntax that works for you try the following:
This should suspend the computer for 60 seconds before restoring. The significant parameter is
mem
You have several options you can choose - play to find the value that works best for you:suspend until a known time
A script (at the bottom of this post) could be used to suspend your computer and wake at a specific time:
syntax is
suspend_until [hh:mm]
for exampleSave the script as the name
suspend_until
and give it execute rights i.e.Cron
You can create a root cron job that calls this script to execute at a specific time in the evening and then awake in the morning:
Now enter something like to run the suspend script at 23:30:
suspend_until script
N.B.
Change
mem
in this part of the script for whatever suspend method works for you:You may also have to substitute the
-u
flag in place of the-l
flag depending on whether your hardware clock uses UTC (-u
) or local (-l
) time. Note that your hardware clock is different from the system clock you see in your operating system.credit to redgeonline
Using rtcwake I have created a simple bash script. It uses php to translate natural language into system time. For example:
sudo ./cu "tomorrow 9am"
sudo ./cu "next monday 3pm"
sudo ./cu "1 hour ago"
rtcwake: time doesn't go backward
You can download it here.
rtcwake
had no effect on my machine. On my Asus motherboard, I had to set the wake time in the bios. I found the setting under Advanced > APM menu and I had to use UTC even though my bios time is set to US Eastern time.Awesome command, thanks for sharing. I added a little more so it sleeps at 11pm and wakes at 8am: