0

I have a daemon/script that runs daily, but I can't find a way to make it run if the computer was off at the scheduled time. Specifically, I'd like:

  • run script/daemon once a day at a X:00 am
  • if computer is off/sleeping at X:00, runs immediately when it wakes
  • if daemon misses scheduled runs (off for several days), it runs once immediately when it wakes

The first point is handled easily with:

<key>StartCalendarInterval</key>
        <dict>
            <key>Hour</key>
            <integer>10</integer>
        </dict>

Running on startup/login when the scheduled time is "missed" is not the (default) behavior of launch agents, despite the suggestion (and later correction) in this question:

How can I get a script to run every day on Mac OS X?

  • Is this a LaunchDaemon (runs as root) or a LaunchAgent (runs as regular users when they're logged in)? – Gordon Davisson Jun 28 '17 at 1:43
  • @GordonDavisson I can run it as either – anon01 Jun 28 '17 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.