Run a job every x minutes with startCalendarInterval in launchd (like using step values “*/x” in cron)

cronlaunchdmacos

I'm using mac osx 10.6 – and it seems that the minutes parameter determines how many minutes past the hour that the job runs. But how do you set up a job to run ever x minutes past the hour.

I've tried setting up minutes as an array of several numbers and an array with one string which is "*/5" i.e. similar to every five minutes syntax for crontab.

Best Answer

ok well here's a solution:

    <key>StartCalendarInterval</key>
<array>
    <dict>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
    <dict>
        <key>Minute</key>
        <integer>55</integer>
    </dict>
</array>

So it seems you need to set up a dict for each repeated job.