Do Maintenance Scripts Run In Sleep Mode?

Discussion in 'Mac Apps and Mac App Store' started by Shrink, Jul 30, 2011.

  1. Shrink, Jul 30, 2011
    Last edited: Jul 30, 2011

    Shrink macrumors G3

    Shrink

    Joined:
    Feb 26, 2011
    Location:
    New England, USA
    #1
    Background: Before I am (appropriately)scolded for not doing my homework - I have done a search in MR and read the threads addressing this issue. I have also read responses on other forums (forae?) addressing my question. In all cases, the answers have been inconsistent. (I have also read Mac information on this issue)

    What is known definitively:
    1) The maintenance scripts run between (about) 3:15AM and 5:30AM.
    2) If the computer is awake (not in sleep mode) the scripts will run during the designated time period.
    3) If the computer is shut down, the scripts will not run.
    4) The scripts can be run manually.

    Points of disagreement:
    1) Some say that if the computer is in sleep mode, the scripts will activate into a standby mode, and the scripts WILL RUN when the computer is awakened.
    2) Some say that being in sleep mode is equivalent to being shut down, and the scripts will NOT run.

    My question: which of the two points above are correct.

    I don't wish to be rude, but I am not looking for opinions. I am, if possible, looking for authoritative responses backed empirically.

    Thank you, in advance, for your responses (if I get any responses after my snotty little statement above ;):p)
     
  2. Shrink thread starter macrumors G3

    Shrink

    Joined:
    Feb 26, 2011
    Location:
    New England, USA
    #2
    63 views - no replies. :(

    I guess my snotty little remark about "opinions" didn't exactly do me any good in getting replies. :eek: Not a good move on my part.

    Replies or no replies - if I offended anyone, my apologies.

    No offense meant... :eek:
     
  3. snberk103 macrumors 603

    Joined:
    Oct 22, 2007
    Location:
    An Island in the Salish Sea
    #3
    Check the logs. I'm not sure which ones (but I'm sure someone else can help).

    If the scripts run, there will be a log entry. Then you can set up a series of experiments and get the empirical evidence - and be the one to post the "...just the facts, ma'am."

    Also - your post title isn't helping the cause. Try something like "Do Maintenance Scripts Run When Sleeping?" In my opinion you'll get more answers. I thought this thread going to be the tired old "How do I run? You don't have to run!" debate.

    Good Luck
     
  4. Shrink thread starter macrumors G3

    Shrink

    Joined:
    Feb 26, 2011
    Location:
    New England, USA
    #4
    Thanks much for the suggestions - especially about my Title. I'll change it now.
    The logs would be all the empirical evidence I need.

    Thanks again...;)
     
  5. Shrink, Aug 3, 2011
    Last edited: Aug 3, 2011

    Shrink thread starter macrumors G3

    Shrink

    Joined:
    Feb 26, 2011
    Location:
    New England, USA
    #6
    Not to be blunt - but you're wrong. ;)

    If you check the logs you find that the scripts run upon waking up the computer, at least if it is sleeping during the designated time period.

    I use a widget (thanks, GGJstudios) called Maintidget which shows the time and date of the past script run. It shows the daily scripts running at the time I woke up the computer, same for weekly and monthly scripts. Haven't tried to see if scripts run if computer is shut down overnight. (I don't shut down overnight)

    Also, the widget will manually run scripts, if you feel the need.
     
  6. X5-452 macrumors 6502

    X5-452

    Joined:
    Feb 16, 2006
    Location:
    Calgary, Canada
    #7
    In my experiences using Onyx, I've noticed that it says my daily scripts have run at the moment when my computer wakes from sleep if it hasn't been awake at the designated time.
     
  7. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #8
    As you've discovered, scripts won't run while the computer is in sleep mode or shut down (nothing runs in that state), but they will run the next time the system is up. This is confirmed.
     
  8. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #9
    Apple used to use the Unix cron framework, I believe, to do this stuff, and the problem was that notebooks (especially) which were asleep would never run the daily/weekly/monthly scripts. At several points, they modified their cron implementations (I think this was about 4-5 years ago) and went from cron to a new framework called launchd (see link). I'm pretty sure that, ever since at least 10.4 and launchd, these scripts get run on/around wake from sleep if they were "skipped" over.

    I think what the other person was responding to was the question of whether the computer will wake itself up to run scripts. I don't think that happens -- just that the scripts don't get skipped because, say, the script is supposed to run at 12:00 and the computer is asleep from 10:00 till 9:00 the next morning.
     
  9. bobr1952 macrumors 68020

    bobr1952

    Joined:
    Jan 21, 2008
    Location:
    Melbourne, FL
    #10
    Absolutely! I remember a discussion like this a couple of years ago so I installed a dashboard widget just to see for myself. They run as soon as your computer wakes. ;)
     
  10. cinematicme, Aug 3, 2011
    Last edited: Aug 3, 2011

    cinematicme macrumors member

    cinematicme

    Joined:
    Aug 2, 2011
    #11
    Both are wrong. A shutdown is a full system halt, everything is unmounted, all process PID's are killed if they are still valid after the system calls for halt.

    Sleeping your mac, is the same (but a hell of alot faster) then sleeping a windows machine. It snapshots your machines current state and reloads it when you open your macbook lid or hit the enter key.

    So to sum up this entire thread, no scripts will not run IN sleep state, and NO, sleeping a mac is NOT the same as shutting it down.

    EDIT: RETRACTED FOR MISREAD
     
  11. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #12
    You misread the statement. They mean that after the computer wakes, the scripts run.
     
  12. cinematicme macrumors member

    cinematicme

    Joined:
    Aug 2, 2011
    #13
    retracted
     
  13. hwojtek macrumors 65816

    hwojtek

    Joined:
    Jan 26, 2008
    Location:
    A small rural village in western Poland
    #14
    Which means, they are postponed until the computer wakes up. Which, in turn, means they are not running when the computer is sleeping. Which means they do not run and I am right. Which means you're wrong but i do not expect you to admit it - not to be blunt.

    You must be kidding me. Scripts running with the computer shut down. I think you have no bloody idea what you're talking about, but next time try to check if they run when you disconnect the mains power cable from the computer. AND remove the battery.
     
  14. Shrink thread starter macrumors G3

    Shrink

    Joined:
    Feb 26, 2011
    Location:
    New England, USA
    #15
    You are , of course, right when you say the scripts don't run during sleep. I believe you will note in an earlier post that I said the scripts run upon waking up the computer, not during sleep. I used some dopey phrase like being in "standby mode until awakening."

    Sorry you took such strong offense. I'm happy to admit when I'm wrong - god knows it happens often enough.
     
  15. hwojtek macrumors 65816

    hwojtek

    Joined:
    Jan 26, 2008
    Location:
    A small rural village in western Poland
    #16
    No need to apologize, as no offense taken - I just love the british way of forum chatting which includes calling everyone else "idiot" etc.
    I think what we've encountered is a classical case of need for precision when using terms "sleeping", "waking" etc - obviously, the scripts themselves do not run, however the clock still works - hence the scripts run after the computer wakes up.

    Cheers,
     

Share This Page