To put it simply, I'm trying to use my computer as an alarm clock. It's slightly old and noisy, so I'd like it to start from power off at a scheduled time and then execute a command, such as playing an MP3 file. I'm running Linux Mint Nadia. How would I go about this?
You can send a magic packet to the computers MAC address. Notice that you need to enable this in your Bios.
Then you can install
For your concern you need another machine to send this packet. For this there are several wake on lan services you can find via google, where you can set a specific time.
From the MythTV's ACPI Wakeup wiki article.
You are looking for a tool called rtcwake. It allows you to suspend your system and specify a specific wake up time. You can then set up a cronjob to play your song at a specified time.
I found a nice example here:
So, in your case, you would set it up to turn the machine on at a couple of minutes before the time you want your alarm to sound and then, set up a cronjob that runs your alarm.
First, suspend your computer and set it to turn on at a specific time, say 9 am. To do this, you need to translate "Tomorrow, 9 am" to UNIX time, seconds since the epoch. You can do this with
Combine that with
So, create a crontab to play your mp3 at 9:05 (run
Now, before going to sleep, just turn off the computer with the