Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Python Wrapper for Cronjobs
1 point by maest on July 31, 2021 | hide | past | favorite | 1 comment
I currently have a Python script I used to notify me whenever my cronjobs fail. My crontab looks like this:

  0 0 * * * job_monitor.py --to user@email --cmd my_cron_script.sh
The script is quite useful - it automatically emails any WARN or ERROR messages or cases where exit code is not 0 - but it's also sort of janky and feature limited.

This feels like it should be a common use-case, but I can't seem to find any open source libraries for this. This usually means one of two things: 1. I'm googling for the wrong thing 2. my approach is somehow wrong.

Are there any Python (or otherwise) tools that provide this behaviour?



Can't you just dispense with job_monitor.py altogether and just use the MAILTO facility?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: