On a lot of linux distros there is the `moreutils` package, which contains a command called `chronic`. Originally intended to be used in crontabs, it executes a command and only outputs its output if it fails. I think this could find another use case here.
Useful enough to justify registering on HN. Thank you!
This is great, I like this. Wrote a 'chronic-file' variant that just dumps everything into a tmpfile and outputs the filepath for the agent in case of error and otherwise nothing