Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Supp0rtLinux

macrumors member
Original poster
Feb 28, 2008
92
27
I've done some searching before posting this, but I'm not finding the answer I'm looking for. I want to be able to do a "one-time hibernate", perhaps through a shell script, maybe via an Automator action, etc but I still want my MBP to "sleep" by default. It seems all the answers to the searches I've tried want me to use pmset to globally change the option from defaulting to sleep to defaulting to hibernate.

Here's my scenario: during the week, sleep is fine for me. However, when I leave on Fridays if I put my laptop to "sleep", then by Sunday afternoon its at about 15-20%. So what I want is to tell it to "hibernate" when I leave on Friday evening so that if I pull my laptop out on Sunday afternoon it has closer to 80-90% of the battery. So I want it to default to "sleep" if I close the lid, but I want a script, shortcut, etc to be able to force it to hibernate. An even better option would be to have it sleep on lid close, but to have the "sleep" option under the Apple menu to say hibernate instead of sleep and to be able to just click that to force it to hibernate. Any thoughts or suggestions?
 

estutmirleid

macrumors newbie
Jun 22, 2012
28
0
So what I want is to tell it to "hibernate" when I leave on Friday evening so that if I pull my laptop out on Sunday afternoon it has closer to 80-90% of the battery.
I don't think that's how Hibernate functions. It still Sleeps as normal, and thus uses battery as normal, but when the battery runs out there's the sleepimage created by Hibernate to recover from.

I'd confirm your hypothesis is correct before pursuing this further, because I'm pretty confident I'm right, based on experience of my own MBP.
 

Supp0rtLinux

macrumors member
Original poster
Feb 28, 2008
92
27
I have a late 2011 MBP… the last of the 15'' MBP's before the rMBP's. Sleep and hibernate are both options. Sleep will have it run on reduced power, but provide power to the memory. When power runs out, it will go to hibernate (deep sleep) where in memory contents are written to the hard disk. I can use pmset option to force it to always deep sleep instead of "regular sleep". But from what I'm seeing, if I use pmset to change the sleep options, its an always thing. In other words… if I use pmset to change the behavior then anytime I close the lid it will deep sleep. I want it to do "normal sleep" anytime I close the lid, but be able to force it to do hibernate (deep sleep) manually.
 

GGJstudios

macrumors Westmere
May 16, 2008
44,556
950
I have a late 2011 MBP… the last of the 15'' MBP's before the rMBP's. Sleep and hibernate are both options. Sleep will have it run on reduced power, but provide power to the memory. When power runs out, it will go to hibernate (deep sleep) where in memory contents are written to the hard disk.
I see what you're saying now. It's a bit confusing, as the terms "hibernate" and "deep sleep" are frequently used to refer to Standby Mode.
I can use pmset option to force it to always deep sleep instead of "regular sleep". But from what I'm seeing, if I use pmset to change the sleep options, its an always thing. In other words… if I use pmset to change the behavior then anytime I close the lid it will deep sleep. I want it to do "normal sleep" anytime I close the lid, but be able to force it to do hibernate (deep sleep) manually.
I'm not aware of any method of achieving what you're trying to accomplish.
 

estutmirleid

macrumors newbie
Jun 22, 2012
28
0
Ok, just to clarify, there are various sleep settings available on Macs. From pmset:

Code:
hibernatemode = 0 (binary 0000) by default on supported desktops. The
     system will not back memory up to persistent storage. The system must
     wake from the contents of memory; the system will lose context on power
     loss. [B]This is, historically, plain old sleep.[/B]

hibernatemode = 3 (binary 0011) by default on supported portables. The
     system will store a copy of memory to persistent storage (the disk), and
     will power memory during sleep. The system will wake from memory, unless
     a power loss forces it to restore from disk image.

hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The
     system will store a copy of memory to persistent storage (the disk), and
     will remove power to memory. The system will restore from disk image. [B]If
     you want "hibernation" - slower sleeps, slower wakes, and better battery
     life, you should use this setting.[/B]
(emphases mine)

Let me also quote the manual once more:
For your sake and mine, please don't use anything other 0, 3, or 25.

At the very least you now know more precisely what you need, ie. setting "25".

Personally, I think whatever you do it'll involve making a global change via pmset that is then undone for Monday when you go back to work.
 

Supp0rtLinux

macrumors member
Original poster
Feb 28, 2008
92
27
Yeah… I'm thinking about a Applescript/shell script called by Automator that sets it to 3 on Monday morning and to 25 on Friday afternoon… perhaps in conjunction with cron or launchd instead of Automator. That part is sort of easy to sort out… I was just hoping for a "default to 3 all the time" but "manually do a 25". Put differently, closing the lid of choosing Apple > Sleep would have it sleep (3) but clicking on my custom script from Applications would have it immediately hibernate (25).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.