Schedule sleep and wake from the Terminal
Like many of us, I’ll be quite busy over the Christmas holiday visiting friends and relatives out of town. I regularly use my home machine as a local fileserver though and other people in the household are dependent on it being up and running. Now here’s the situation I’m presented with: I leave town earlier than my housemates do, but I don’t want to have to rely on someone who is not particularly computer savvy to put my Mac to sleep, so what do I do? Schedule it!
Being a bit on the geeky side, I’ll do this from the command line, which serves two purposes:
1) it’s geeky
2) it is exactly what you could do if you are currently away from your Mac but want to schedule sleep and wake remotely.
Here’s how you can schedule sleep and wake via the command line, remember you can do this remotely by SSH’ing into the Mac you want to schedule:
pmset schedule sleep "12/24/2009 00:00:00"
Now my system will go to sleep on Christmas Eve, the 24th of December.
pmset schedule wake "12/26/2009 00:00:00"
This command insures that my Mac wakes up the day after Christmas
That’s all there is to it! Now my Mac will sleep and wake on it’s own, independent of anyone else interfering with the machine. Note that you can do all of this through the Energy Saver GUI too but that’s not as fun (for me at least).