Giter Site home page Giter Site logo

crustymonkey / cron-wrap Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 0.0 36 KB

This is a script that is used to wrap cronjobs to suppress/batch output

Home Page: http://stuffivelearned.org/doku.php?id=programming:python:cwrap

License: GNU Lesser General Public License v3.0

Python 76.06% Roff 23.94%

cron-wrap's People

Contributors

crustymonkey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cron-wrap's Issues

bug in emailing user other than crontab owner

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'

feature request - backoff on x number of -n failures

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.

feature request - ability to log to syslog while respecting fail_num

This may be by design, not sure....

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.