I have some python scripts that run on a daily basis in cron. How can I have cron send me an email ONLY WHEN THERE IS STDERR OUTPUT from my script? I want to be able to mail multiple recipients, and set the subject line individually for each cron entry.
I tried this:
./prog > /dev/null | mail . . .
but it didn't work -- I still receive blank emails when there is no STDERR. Do I need to do this in the script itself?
Sorry if this seems basic, I have googled a lot but can't seem to find this answered succintly.
TIA, Noah