seems failing on the initial run is glitched when -R is used.
cwrap.py -f -t 3600 -S LOG_LOCAL6 -R [email protected] ls /blah
Traceback (most recent call last):
File "/usr/bin/cwrap.py", line 828, in
main()
File "/usr/bin/cwrap.py", line 812, in main
comSt = stFh.getObject()
File "/usr/bin/cwrap.py", line 92, in getObject
self._upgrade(obj)
File "/usr/bin/cwrap.py", line 108, in _upgrade
cmdState._lastEmailNum = 0
AttributeError: 'NoneType' object has no attribute '_lastEmailNum'
It'd be good to be able to have a backoff time for persistent failures.
Example:
I have a cron job which runs every minute, i use -n 5 so temporary failures don't alert me. I've just come in to find that it's been down over the weekend, and i'm greeted with 1240 emails.
It would be good to be able to say "if -n fails X number of times, back off for X minutes" Which means after say, 3 groups of -n 5 jobs fail (so three emails) prevent trying the job again for 24 hours.
This would lower the 1240 emails, to about 9 or 10.
It would be super handy for the task i'd like to use cron-wrap for, if I could make cron-wrap email someone other than the crontab owner, (possibly just by calling out to the mail command with the report contents) ?
Currently cwrap.py -S -n 5 will output on the fifth error, but will still log all failures to syslog.
I want to only log to syslog on the fifth failure, as i'm also using -C to log to a specific facility, and those log messages are raised as alerts in our monitoring system.
A switch option to make cwrap's syslogging respect the -n value would be super useful.