Skip to content

Scheduling

Gil Burns edited this page Apr 22, 2026 · 1 revision

Scheduling

The patcherscheduler daemon wakes up every 10 minutes and checks whether any of the four patching phases are due. Most of the time it exits in milliseconds having done nothing; work only happens when a phase interval has elapsed.


LaunchDaemon

The daemon is managed by:

/Library/LaunchDaemons/com.gilburns.patcher.scheduler.plist

It runs as root, which is required so Installomator can install applications system-wide.

Key plist settings:

Key Value Reason
StartInterval 600 (10 min) Polling cadence — cheap when nothing is due
RunAtLoad true Runs once immediately on load (install, reboot)
SessionCreate true Required for launchctl asuser to display swiftDialog in the user's GUI session

Phase Intervals

Each phase has its own interval preference:

Phase Preference Key Default
Scan ScanIntervalDays 30 days
Check CheckIntervalHours 4 hours
Stage StageIntervalHours 4 hours
Apply ApplyIntervalHours 24 hours

The scheduler records the last run time for each phase in Config/config.json and compares it against the current time on every wake.

Scan-on-Label-Update

When Installomator labels or Managed Labels are updated to a new version, the scan phase runs immediately regardless of the ScanIntervalDays interval. This ensures newly available labels are evaluated without waiting for the next scheduled scan.

Controlled by: ScanOnLabelUpdate (default: true)


Monthly Patching Cadence

For environments that follow a monthly "Patch Tuesday" style schedule, set MonthlyPatchingCadenceEnabled to true. In this mode the apply phase is gated to a specific week and day of the month instead of running on the ApplyIntervalHours interval alone.

Relevant keys:

Key Default Description
MonthlyPatchingCadenceEnabled false Enable monthly mode
PatchingWeekday 3 Day of week (1=Sun … 7=Sat; 3=Tue)
PatchingWeekOfMonth 2 Which occurrence of that weekday (2 = second Tuesday)
PatchingStartTime "" Optional HH:MM — don't start applying before this time
PatchingEndTime "" Optional HH:MM — don't start applying after this time

In monthly mode the scheduler will not begin the apply phase until the configured patch day. Once the patch day arrives, ApplyIntervalHours still governs how often apply runs within that window.

Note: Deadline counters behave differently in monthly mode. In standard mode, daysPendingForDeadline counts from firstPendingDate. In monthly mode, it counts from the configured patch day of the current cycle. See Deferral and Deadlines.


Startup Delay (Random Jitter)

To avoid all machines hammering external services simultaneously after a reboot, an optional random startup delay can be enabled:

Key Default Description
InitialScanDelayEnabled false Enable the startup delay
InitialScanDelayMaxSeconds 86400 Maximum jitter (default: up to 24 hours)

The scheduler picks a random number of seconds between 0 and InitialScanDelayMaxSeconds and waits that long before running the first scan after a cold start.


Controlling the Daemon

# Check status
sudo launchctl print system/com.gilburns.patcher.scheduler

# Unload (stop)
sudo launchctl bootout system/com.gilburns.patcher.scheduler

# Load (start)
sudo launchctl bootstrap system /Library/LaunchDaemons/com.gilburns.patcher.scheduler.plist

# Trigger a run immediately
sudo launchctl kickstart system/com.gilburns.patcher.scheduler

Log Files

The LaunchDaemon captures crash output to:

/Library/Logs/Patcher/scheduler_stdout.log
/Library/Logs/Patcher/scheduler_stderr.log

Detailed operational logs written by patcherscheduler itself go to:

/Library/Logs/Patcher/patcherscheduler.log

See Logs and Troubleshooting for more.

Clone this wiki locally