cronguard
Wrap cron jobs with execution tracking, timing, output capture, and exit code reporting.
Install
pip install cronguard
uv add cronguard
brew install cronguard
Usage
Basic run
cronguard run "echo hello"
With a timeout (seconds)
cronguard run "backup.sh" --timeout 300
With a human label
cronguard run "deploy.sh" --label "nightly-deploy"
JSON output (good for piping to monitoring)
cronguard run "test.sh" --json
Quiet mode (only output on failure)
cronguard run "cleanup.sh" --quiet
Drop it in your crontab
# Run backup every night at 2am, timeout after 1 hour
0 2 * * * cronguard run "/home/me/backup.sh" --label "nightly-backup" --timeout 3600 --quiet 2>&1 | logger -t cronguard
The --quiet flag keeps things silent when everything works. If the job fails, cronguard prints the full report so logger (or your monitoring) picks it up.
All options
cronguard run COMMAND [OPTIONS]
Arguments:
COMMAND The command to run
Options:
--timeout, -t FLOAT Timeout in seconds. Exit code 124 on timeout.
--label, -l TEXT Human-readable label for this job.
--json, -j Output results as JSON.
--quiet, -q Only output on failure. Silent success.
Global:
--version, -V Show version and exit.
--help Show this message and exit.
Why I built this
Cron jobs fail silently. You set up a backup script, forget about it, and three months later you find out it has been broken the whole time. I wanted something dead simple that wraps any command and gives you timing, exit codes, and captured output so you can pipe it into whatever alerting you already use. No daemons, no config files, just prefix your cron command with cronguard run and you get visibility.
License
MIT
Metadata
Release files for cronguard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cronguard-0.1.0.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cronguard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / cronguard-0.1.0.tar.gz
| Download URL | cronguard-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd35f0b47f19a0c79865ab2007143a53797f2568b33cb6b0d26a7a2ac8ec7899
|
|
BLAKE2b-256 checksum How to use checksums |
fb54c9359ab8212a80cd43d05149f7e80bc0a1929b27cbf8e00a14600d47342b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|
Release files / cronguard-0.1.0-py3-none-any.whl
| Download URL | cronguard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29889ad0113fb8b7d5a4e2a8d1baff9a01f639c3c4ba48c7c68df0116889c6d7
|
|
BLAKE2b-256 checksum How to use checksums |
7374e56adddb3bd573cf87b2197f6d60757fd38c46b281af1b8616f8118b3217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|