Image

Imagenomadphoenix wrote in Imagelinux

Cron advice

Trying to help my company out with organizing cronjobs across 6 production servers. The problem is the volume of messages we get every business day.

Right now, scripts under my responsibility get redirected to a log file, leaving only stderr to be posted by email. Last weekend I tried something along the following lines to try and organize things better.

` /path/to/cronjob/script | mail -s "[Category][script subject]" cronjobs@mycompany.com > /dev/null`

Unfortunately mail only grabs stdout and not stderr. Is there some other better or effective way to grab the output of a cronjob? Really all I want is some way to insert a subject header into the script reports so whoever knows what they are looking at instead of a 45-80 character long command line.