I read that if the computer is sleeping when a launchd event is to occur, then launchd will run the event when the computer wakes up.
My question is in regards to a computer that is shut down. If the machine is powered off when a launchd event is to occur, is launchd supposed to run it at the next power-on?
I ask because I have created an event (agent?) to run at 09:45am every day. But often the machine is powered off at that time. I am not seeing the output of the event (an email being sent) after I power on the computer. So I am trying to narrow down if this is behavior by design or have I messed something up.
Answer
It's limited to jobs that were scheduled during sleep (not when shut down) and by a StartCalendarInterval parameter (not StartInterval).
Daemons and Services Programming Guide: Scheduling Timed Jobs
If you schedule a
launchd
job by setting theStartCalendarInterval
key and the computer is asleep when the job should have run, your job will run when the computer wakes up. However, if the machine is off when the job should have run, the job does not execute until the next designated time occurs.All other
launchd
jobs are skipped when the computer is turned off or asleep; they will not run until the next designated time occurs.
Comments
Post a Comment