How a Developer Built Self-Healing macOS launchd Jobs Using Done-Marker Logic
A developer shared a technique for making macOS launchd jobs resilient to mid-run failures caused by sleep interruptions, network unavailability, or process timeouts. The approach schedules multiple daily firing slots in a plist file, so if an early attempt fails, later slots automatically retry the same task. A done-marker file is written only upon successful completion, allowing subsequent slots to detect success and exit immediately without redundant work. For long multi-step jobs, per-step half-markers ensure only failed steps are retried rather than repeating already-completed work. The pattern was developed after repeated failures updating an Obsidian Vault via Claude Code, where jobs silently died but still reported exit code 0.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in