I have a launchd job plist that runs a simple shell script that invokes rdiff-backup to backup a remote directory over SSH to my computer. The job runs every hour and it works well.
Except the other day there was a power failure* and the rdiff-backup job was interrupted. The next time launchd ran the script, rdiff-backup failed and logged it's failure to the path specified in the plist. launchd, noticing the abnormal exit code, stopped trying to run the script.
And I had no idea for six days.
Obviously I don't want a notification of the exit code every time the script finishes. What can I do to be notified only of abnormal exits?
(*) turns out my UPS battery was passing the self-test when invoked, but didn't actually have the ability to power even a minimal load for more than 3 seconds.