launchd plist with large StartInterval never runs

元气小坏坏 提交于 2021-01-29 16:12:05

问题


I'm trying to run a command once per day like so:

<?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>Label</key>
    <string>local.borgmatic</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/borgmatic</string>
        <string>--syslog-verbosity</string>
        <string>1</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
        <key>HOME</key>
        <string>/Users/mike</string>
    </dict>
    <key>StartInterval</key>
    <integer>86400</integer>
</dict>
</plist>

The problem is this job never seems to run on its own. Even if it failed, I'd expect to see an error message from launchd in system.log, but I don't see anything, even after leaving my computer running for several days with hibernation disabled. The job shows up in launchctl list and runs fine when I start it manually via launchctl start. It also runs automatically when I reduce StartInterval to something smaller, like 10. Does StartInterval have some undocumented maximum?

Incidentally, this looks like the same problem reported at OS X launchd.plist.

来源:https://stackoverflow.com/questions/65852871/launchd-plist-with-large-startinterval-never-runs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!