14

Is it possible to wake up Ubuntu from hibernation at a predefined time? It should not be WOL, but rather Ubuntu waking itself up. For example, it should do what the app WakeupOnStandBy does on MS Windows.

3 Answers 3

12

When hibernating, the operating system is off and can't do anything. It's the computer's BIOS that does the waking up, so it's only possible if your computer's BIOS supports it. With some BIOSes, you can configure a scheduled wakeup quite easily.

Press the key that gets you into "setup" or similar when the computer first boots up (often F2 or Del) and see what options you have.

Alternatively you may be able to configure the BIOS to wake from Ubuntu, if the BIOS supports waking and allows the OS access to configure it. This guide is quite comprehensive:
http://www.mythtv.org/wiki/ACPI_Wakeup

2
  • Is this also true for suspension (vs. hybernation)? Jun 16, 2011 at 10:20
  • This is the correct answer. BIOS should support wake up at a certain time feature.
    – powerrox
    Mar 16, 2012 at 1:46
7

I found that it is difficult to wakeup Ubuntu from hibernation. So I use the following commands to boot Ubuntu at a predefined time:

# Clear previously set wakeup time 
sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"

# Set the wakeup time at 2:02 am
sudo sh -c "echo `date '+%s' -d '2am next day + 2 minutes'` > /sys/class/rtc/rtc0/wakealarm"

#Check if alarm is set. It should show the unix time stamp
cat /sys/class/rtc/rtc0/wakealarm

#After setting the time, PC can be turned off with this command
sudo shutdown -P now 

This setup has been very consistent and it has never failed. Auto-login should be enabled during Ubuntu installation for this to work, or else Ubuntu will wait at the login screen when it auto boots up. More info here.

1
  • 3
    I just tried this but with 'pm-suspend' instead of shutdown and the computer woke up at the time I set in wakealarm file. Thanks!
    – AXE Labs
    Jan 20, 2015 at 5:54
0

Since hibernation implies power-off I wonder if your BIOS supports automatically booting on power application. If so, you could cycle your power supply using an external timer or some other device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .