3 ms·
My system could be improved, but I wrap cronjobs in a shell script that doesn't output anything on non-error exit codes. It doesn't do de-dupe, it's a quick ha
by sneak 7y ago
My system could be improved, but I wrap cronjobs in a shell script that doesn't output anything on non-error exit codes. It doesn't do de-dupe, it's a quick hack.
Wrapper:
https://git.eeqj.de/sneak/hacks/src/branch/master/cronify/cronify https://git.eeqj.de/sneak/hacks/src/branch/master/cronify/cr...
In /root/.forward:
|"/usr/bin/envdir /etc/environment.d /usr/local/bin/email_to_webhook"
That email_to_webhook can be found here:
https://gist.github.com/sneak/2b7d5348efcf00e7537a69dccef93da6 https://gist.github.com/sneak/2b7d5348efcf00e7537a69dccef93d...
The script isn't mine, I found it somewhere.
I try to set up my cronjobs so that they don't output anything to stdout (they can log to syslog, logs are collected) if the process doesn't need attention. If it shows up in slack, I deal with it.
To do what you're trying to do, I'd figure out some way of getting my cron output into Sentry, or maybe just Sentry-ify all of my cron processes like you would do with any other program, and then ignore their output/return codes when running from cron.