On man launchd.plist
it says (emphasis mine)
StartCalendarInterval This optional key causes the job to be started every calendar interval as specified. Missing arguments are considered to be wildcard. The semantics are similar to crontab(5) in how firing dates are specified. Multiple dictionaries may be specified in an array to schedule multiple calendar intervals.
My plist file is /Users/enricozb/test.plist
and contains
<?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>com.enricozb.test</string>
<key>ProgramArguments</key>
<array>
<string>date</string>
</array>
<key>StandardOutPath</key>
<string>/Users/enricozb/test.txt</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>21</integer>
</dict>
</dict>
</plist>
Notice that Hour
is set to 21
, aka, 9PM. Also, notice that the command is just basically date > /Users/enricozb/test.txt
. I ran
launchctl load /Users/enricozb/test.plist
launchctl start com.enricozb.test
This fires once right after the launchctl start
command, and never again.
I was assuming that since the documentation says that missing arguments are wildcard, that the Minute
field would be wildcard too. Why is this not running every minute?