在launchd中使用startCalendarInterval每x分钟运行一个作业(比如在cron中使用步骤值“*/x”)?

时间:2021-12-20 01:09:57

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.

我使用的是mac osx 10.6——分钟参数似乎决定了作业每小时超过多少分钟。但是你如何设置一个工作,让它每小时运行x分钟。

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.

我尝试过将分钟设置为由几个数字组成的数组,以及一个字符串“*/5”的数组,即类似于crontab的每五分钟语法。

1 个解决方案

#1


7  

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.

因此,似乎你需要为每一项重复的工作设置一个命令。

#1


7  

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.

因此,似乎你需要为每一项重复的工作设置一个命令。