LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   cron job mailing blank output (https://www.linuxquestions.org/questions/linux-general-1/cron-job-mailing-blank-output-490877/)

rsmccain 10-09-2006 01:24 PM

cron job mailing blank output
 
I have this in roots crontab:

1 6-18 * * 1-5 /usr/bin/perl /downloads/postfix-2.1.6/auxiliary/qshape/qshape.pl | mail -s "Mail Report" admin@domain.com


--

When I run it from the command line, the mail goes to admin@domain.com fine with the correct output.

However, When cron runs it, a blank message gets sent rather than the output from qshape.pl.

Any ideas?

trickykid 10-09-2006 03:30 PM

Try adding this to the crontab instead

MAILTO=admin@domain.com

And if you don't want any cron's to email or have any output, just do the standard..

1> /dev/null 2>&1

Or the like at the end of the command..

rsmccain 10-09-2006 03:37 PM

thanks.. one more question.
 
Quote:

Originally Posted by trickykid
Try adding this to the crontab instead

MAILTO=admin@domain.com

And if you don't want any cron's to email or have any output, just do the standard..

1> /dev/null 2>&1

Or the like at the end of the command..

Can I specify 2 email addresses seperated by a command perhaps? ie: MAILTO=admin@domain.com, admin2@domain.com

Thanks.. Ryan

trickykid 10-09-2006 03:56 PM

Quote:

Originally Posted by rsmccain
Can I specify 2 email addresses seperated by a command perhaps? ie: MAILTO=admin@domain.com, admin2@domain.com

Thanks.. Ryan

I think so but can't remember off top of my head. Refer to man pages for crontab or google it, I'm sure it's possible.

rsmccain 10-09-2006 04:00 PM

thanks, but...
 
Quote:

Originally Posted by trickykid
I think so but can't remember off top of my head. Refer to man pages for crontab or google it, I'm sure it's possible.

..any idea why it wasn't working originally?

Ryan


All times are GMT -5. The time now is 12:31 PM.