Search

Top Posts

Comments

  • hadjime: Doesn’t work on me… i remove the file and then i open photo booth and it’s still wotking
  • John Doe: I’m having a bit of trouble trying to install fink, I know how to execute the command lines but I...
  • Slopjong: The same to me. It doesn’t work on 10.5.
  • Pascal (Former  IS&T France): It would be nice if the equalizzer could remember your prefered eq setting...
  • Pencil: Attention: Activating equalizer has serious impact on your battery lifetime!

Categories

Recent Posts


Schedule sleep and wake from the Terminal

terminal-icon-512x5122 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).

Posted by: Bill Ellis

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 4

Comment from Carl
Time: December 18, 2009, 6:25 am

Nice. Even faster than using the GUI. Are the scheduled event added through pmset reflected in the energy saver prefpanel? Also, is it possible to schedule reccuring events through pmset? (I know I could try it out or check the man page, but I feel lazy + It’s somewhat a good point of discussion)

cheers.

Comment from BitterMacFace
Time: December 18, 2009, 2:22 pm

@Carl, yes the pmset command changes are reflected in Energy Saver panel, you’ll notice that any setting made by pmset beyond the norm adjusts things within the preferences GUI to “Custom”

pmset has a ton of other possibilities, like timing boots, shutdown, sleep, I am about 95% sure the Energy Saver GUI is just a front end to the pmset command itself.

Comment from lostinasafari
Time: January 9, 2010, 8:46 pm

hi, i tried this, and its telling me “pmset: this operation must run as a root” is it because i have 10.6? :P

Comment from Chip
Time: January 25, 2010, 11:02 pm

lost: no, you just need to run it with “sudo” in front of the “pmset….” it just wants to make sure you’re a system admin :)

Write a comment






December 18th, 2009