问题
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