Easy. First you need to check if your computer supports wakup on RTC. Most computers created in the last 10 years support this feature. First you need to enable RTC in BIOS settings, this is done in the boot process. On my BIOS it's possible to configure what S-signals the wakeup should respond to. Because I like to save energy I completly let my computer power down in between automatic startups and shutdowns.
After BIOS is setup, boot up Linux and issue command dmesg |grep rtc. This tells you if you have RTC wakeup enabled. My output gives:
~$ dmesg |grep rtc
[ 0.962976] rtc_cmos 00:03: RTC can wake from S4
[ 0.963096] rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
[ 0.963119] rtc0: alarms up to one month, 242 bytes nvram
To set the wakeup time you need to be root. As root issue command:
echo 0 > /sys/class/rtc/rtc0/wakealarm
The above command should be used before you write a new wakeup time to the file, otherwise the wakeup resource will be buisy.
If you want your computer to start up in 10 minutes in the future issue command:
echo `date '+%s' -d '+ 10 minutes'` > /sys/class/rtc/rtc0/wakealarm
Check if alarm is set by issuing cat /sys/class/rtc/rtc0/wakealarm. If you get a bunch of digits it means that the alarm is set and if the file is empty there was something wrong with the date.
To check a more human readable format issue command cat /proc/driver/rtc.
So, if you want your computer to start 2 minutes after someone turns it off, execute a script that looks something like this from your crontab(this script will require root access, so be aware):
#!/bin/bash
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo `date '+%s' -d '+ 2 minutes'` > /sys/class/rtc/rtc0/wakealarm
Save the planet. :)