DomT4 / homebrew-autoupdate

:tropical_drink: An easy, convenient way to automatically update Homebrew.
BSD 2-Clause "Simplified" License
995 stars 55 forks source link

When does this run? #9

Closed Skeyelab closed 7 years ago

Skeyelab commented 7 years ago

When does this run?

DomT4 commented 7 years ago

On boot & then every 86400 seconds/24 hours after.

Skeyelab commented 7 years ago

and if the computer is asleep when its supposed to run? Will it go when it wakes up? or it misses that one and just waits till the next day?

Thanks.

DomT4 commented 7 years ago

Sorry, had to chase down the answer on this one because I wasn't sure off the top of my head. Some of the information around is a little conflicting but it seems like if the Mac is asleep when the job is supposed to run it'll run on wake.

Unlike cron which skips job invocations when the computer is asleep, launchd will start the job the next time the computer wakes up. If multiple intervals transpire before the computer is woken, those events will be coalesced into one event upon wake from sleep.

If you schedule a launchd job by setting the StartCalendarInterval 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.

DomT4 commented 7 years ago

Presuming the above has answered the question but let me know otherwise 😃.