Force hibernate, but default to sleep

Discussion in 'OS X Mountain Lion (10.8)' started by Supp0rtLinux, Mar 4, 2013.

  1. macrumors member

    Joined:
    Feb 28, 2008
    #1
    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?
     
  2. macrumors newbie

    Joined:
    Jun 22, 2012
    #2
    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.
     
  3. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #3
    If the Mac you're referring to is not a retina MBP or MBA, hibernation (aka "deep sleep" or "standby mode") is not an option, as it's not available on other models.

    Mac notebooks: About standby mode
     
  4. macrumors newbie

    Joined:
    Jun 22, 2012
    #4
    That's a different feature that allows a certain amount of activity such as Mail downloading etc. when the notebook is in "sleep" and is, indeed, only available on certain models.
     
  5. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #5
    You're thinking of Power Nap, which also is only available on MBA and rMBP models. Neither Power Nap nor Standby Mode is available on other Mac models.

    Mountain Lion: About Power Nap
     
  6. thread starter macrumors member

    Joined:
    Feb 28, 2008
    #6
    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.
     
  7. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #7
    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'm not aware of any method of achieving what you're trying to accomplish.
     
  8. macrumors newbie

    Joined:
    Jun 22, 2012
    #8
    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:
    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.
     
  9. thread starter macrumors member

    Joined:
    Feb 28, 2008
    #9
    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).
     

Share This Page