I certainly don't mean to imply that the causal arrow points from launchd to power state; the opposite, actually! I'm just working to better understand Mac sleep.
(And yep, pmset -g is a fun little corner!)
The reason I am interested in the precise details of when StartCalendarInterval ends up running a job is that the available resources and limits of a Mac are different in these different power states.
I have to code with that in mind.
Re:my scheduled job I fear it will cause you fine and patient Apple folk to bristle, as its purpose is to work around Time Machine, uh, "changes" I have encountered. To wit:
"Time Machine did not finish backing up because some files were unavailable. Backups will resume when your Mac is unlocked." can be avoided by keeping the Mac awake and unlocked (caffeinate -d) during backup.
Time Machine *.sparsebundle "disk not ejected properly" errors can be prevented by using a script-assisted backup that verifies unmounting prior to sleep.
And I can speculate all day about changes to the SMB stack or whatever the root cause that makes my macOS 26 machine require 8 hours of trying to complete before it fails a backup, but I know that debug.lowpri_throttle_enabled=0 before backup gets me to a successful backup in about 2 hours.
SO, this particular job schedules a script that applies all of these workarounds, executes tmutil startbackup --auto --block, and cleans up afterward.
(And my apologies, I do realize this has strayed far from my posted topic/title. Thanks for reading =-)
Topic:
App & System Services
SubTopic:
Core OS
Tags: