Skip to main content

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

Project description

Basic example of usage:

##Will print out help
$ cronwrap -h

    usage: cronwrap3 [-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
                            "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 maximum running time.If this time is passed an
                            alert email will be sent.The command will keep running
                            even if maximum 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 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

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

cronwrap3-1.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

cronwrap3-1.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file cronwrap3-1.0.1.tar.gz.

File metadata

  • Download URL: cronwrap3-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for cronwrap3-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2c0fc9ded6f67cf604d7bd3daa63f262e43efbaba3fd569408d514af39689ade
MD5 a3b27c21e57c2c92d66cedcb6fdfec90
BLAKE2b-256 cf1602e3d4cc288c5bc0ac209259f5b4ba5fd3a954232c418555b94e0685dcfb

See more details on using hashes here.

File details

Details for the file cronwrap3-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cronwrap3-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for cronwrap3-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c4fc62b201aa893a0207ece8e460ec12cb6c8fa48ad76ed923466c4d48fa697
MD5 eec198874b5a08776daab5dc0847ba8c
BLAKE2b-256 4e43f859aacca77ab4673f7f15521050a6feb94422002a6c363b8dc87dac5932

See more details on using hashes here.

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