Skip to main content

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

Project description

Basic example of usage:

##Will print out help
$ cronwrap -h

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

    Runs a command and has the ability to email if the command crashes or runs for
    too long.

    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
                            "johndoe@mail.com, marcy@mail.com"`. 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.The command will keep running
                            even if maxium running time is exceeded.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 succefull 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 succefull report to cron@my_domain.com:
$ cronwrap -c "ls" -e cron@my_domain.com -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cronwrap-1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

cronwrap-1.0-py2.6.egg (3.6 kB view details)

Uploaded Source

File details

Details for the file cronwrap-1.0.tar.gz.

File metadata

  • Download URL: cronwrap-1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cronwrap-1.0.tar.gz
Algorithm Hash digest
SHA256 44e16e049b06de627dd8ac852ac2400df0dfd1edc658c6bbd7a8a5a7fbb9e7e1
MD5 a0cdacf7e40636fbdee8547d0ec3f945
BLAKE2b-256 b1e19567c97987c98b0c581e68036be31c50c091ff1e4c53cdc3e96a4cbb8458

See more details on using hashes here.

Provenance

File details

Details for the file cronwrap-1.0-py2.6.egg.

File metadata

  • Download URL: cronwrap-1.0-py2.6.egg
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cronwrap-1.0-py2.6.egg
Algorithm Hash digest
SHA256 316c4ba75067c25d09ff42977da25470675d5a8e4871541139ecba2b081180af
MD5 b4f02d8bc0f3dce65777faa0df777750
BLAKE2b-256 0532bbaf516ee46acf61e909850c08a0df8fb513ca87397819eef775be30c993

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page