I'm aware this won't quite fix the original issue but hopefully will tell us if the issue is a bug in launchd
or something else.
Have you tried removing the cron
job and re-instituting it as a proper launchd
job instead? launchd
is supposed to run the cron
jobs but it sounds like you may be running into a bug.
You can create a launchd
job using a GUI such as Lingon if you'd prefer instead of making the .plist yourself.
Sample .plist:
<?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>test.dood.123</string>
<key>ProgramArguments</key>
<array>
<string>cd</string>
<string>/Library/REMOVED/DIRS/report/</string>
<string>&&</string>
<string>nice</string>
<string>-n</string>
<string>15</string>
<string>/usr/local/php5/bin/php</string>
<string>-f</string>
<string>report_generator.php</string>
<string>></string>
<string>/dev/null</string>
<string>2>&1</string>
</array>
<key>StartInterval</key>
<integer>60</integer>
</dict>
</plist>
From my Googling it sounds like it's a bug in launchd
running cron
jobs. Source: 1
StartInterval will simply run it that many seconds from when the job was last run.
StartCalendarInterval will allow you to run it at set times and instead of the <key>StartInterval</key>
in the sample above use the following:
Run only at 3:15 AM
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
Run every 5 minutes - StartCalendarInterval with an array. (I don't know of a better way to write this out so I'd love someone to elaborate on this)
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Minute</key>
<integer>5</integer>
</dict>
<dict>
<key>Minute</key>
<integer>10</integer>
</dict>
<dict>
<key>Minute</key>
<integer>15</integer>
</dict>
<dict>
<key>Minute</key>
<integer>20</integer>
</dict>
<dict>
<key>Minute</key>
<integer>25</integer>
</dict>
<dict>
<key>Minute</key>
<integer>30</integer>
</dict>
<dict>
<key>Minute</key>
<integer>35</integer>
</dict>
<dict>
<key>Minute</key>
<integer>40</integer>
</dict>
<dict>
<key>Minute</key>
<integer>45</integer>
</dict>
<dict>
<key>Minute</key>
<integer>50</integer>
</dict>
<dict>
<key>Minute</key>
<integer>55</integer>
</dict>
</array>
For more check out the Migrating from cron section on the documentation for launchd and man page