Automatically put computer to sleep and wake it up on a schedule

Ever wanted your computer to be on when you need it but automatically put itself to sleep (suspended) when you don’t? Or maybe you just wanted to create a really elaborate alarm clock? I stumbled across this very useful command a while back but only recently created a script that I now run to control when my computer is suspended and when it is awake. #!/bin/sh t=`date –date “17:00” +%s` sudo /bin/true sudo rtcwake -u -t $t -m on & sleep 2 sudo pm-suspend This creates a variable, t above, with an assigned time and then runs the command rtcwake to tell the computer to automatically wake itself up at that time.