The wonderful cron-sentry takes care of sending an event for program errors to sentry. To uniformy log everything outputted, we pipe both stderr and stdout to logger (should be available on most linux distros)
Download script, add execution perm and move to a directory on PATH
$ wget https://gist.githubusercontent.com/asfaltboy/23a7f963bbfcb48ce510307ec8cb8737/raw/49ebca20004211a16c85a61a77db7d0883ddf31c/log-and-sentry
$ chmod +x log-and-sentry
$ mv log-and-sentry
[email protected] # useful to debug errors with cron-sentry execution
SENTRY_DSN=<your dsn uri> # to avoid repeating `cron-sentry --dsn`
@hourly log-and-sentry do_something arg -a arg2