GithubHelp home page GithubHelp logo

mbafford / cronwrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from doist/cronwrap

0.0 1.0 0.0 131 KB

A cron job wrapper that wraps jobs and enables better error reproting and command timeouts.

Home Page: http://pypi.python.org/pypi/cronwrap

Python 100.00%

cronwrap's Introduction

cronwrap

A cron job wrapper that wraps jobs and enables better error reporting and command timeouts.

Installing

To install cronwrap simply do::

$ sudo easy_install cronwrap
$ cronwrap -h

Example

Basic example of usage::

##Will print out help
$ cronwrap -h

    usage: cronwrap [-h] [-c CMD] [-e EMAILS] [-t TIME] [-v [VERBOSE]]

    A cron job wrapper that wraps jobs and enables better error reporting and command timeouts.

    optional arguments:
      -h, --help            show this help message and exit
      -c CMD, --cmd CMD     Run a command. Could be `cronwrap -c "ls -la"`.
      -e EMAILS, --emails EMAILS
                            Email following users if the command crashes or
                            exceeds timeout. Could be `cronwrap -e
                            "[email protected], [email protected]"`. Uses system's
                            `mail` to send emails. If no command (cmd) is set a
                            test email is sent.
      -t TIME, --time TIME  Set the maxium running time. If this time is passed an
                            alert email will be sent once the command ends.
                            The command will keep running even if maximum running time
                            is exceeded. Please note that this option doesn't
                            prevent the job from stalling and does nothing to
                            prevent running multiple cron jobs at the same time.
                            The default is 1 hour `-t 1h`. Possible values include:
                            `-t 2h`,`-t 2m`, `-t 30s`.
      -v [VERBOSE], --verbose [VERBOSE]
                            Will send an email / print to stdout on successful run.


##Will send out a timeout alert to cron@my_domain.com:
$ cronwrap -c "sleep 2" -t "1s" -e cron@my_domain.com

##Will send out an error alert to cron@my_domain.com:
$ cronwrap -c "blah" -e cron@my_domain.com

#Will not send any reports:
$ cronwrap -c "ls" -e cron@my_domain.com

#Will send a successful report to cron@my_domain.com:
$ cronwrap -c "ls" -e cron@my_domain.com -v

cronwrap's People

Contributors

desktable avatar imankulov avatar lowks avatar

Watchers

 avatar

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.