Ubuntu 14.04lts with Perl 5.18.2.
This is a special case where Google did not help me. I do not want to turn off email for all cron jobs, I have about 15 jobs in my crontab. I need to see the emails cron sends me if there are errors.
This one job is a special case for which I need a solution. I have a bash script in my crontab which calls a perl script which is setup to check for email every 5 minutes. (It is not possible for me to setup a full MTA.) If there is no email the script does not output anything to STDOUT or STDERR yet cron still sends me a blank email with the full path of the bash script in the subject.
- I want cron and the Perl script to send me email if the perl script finds email and processes it, including if there are errors.
- I don't want cron to send me a blank email if there is no output from the Perl script because no email was found. The script runs every 5 minutes.
Anyone have any ideas?
EDIT: Confirmed. It was a stray newline that was my problem. Problem solved. Cron does not send an email if there is no output. Thank you! Your comment helped.