我正在使用 launchd 运行一个应该每天运行一次的脚本。但它运行了多次(比如 40 次)直到最终停止。以下是脚本:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>emailStats</string>
<key>Program</key>
<string>[redacted]</string>
<key>UserName</key>
<string>[redacted]</string>
<key>ExitTimeOut</key>
<integer>7200</integer>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>9</integer>
</dict>
<key>StandardOutPath</key>
<string>[redacted]</string>
<key>StandardErrorPath</key>
<string>[redacted]</string>
</dict>
</plist>
答案1
如果您省略“分钟”对,它将每分钟运行一次。