LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 10-09-2006, 02:24 PM   #1
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Rep: Reputation: 30
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?
 
Old 10-09-2006, 04:30 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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..
 
Old 10-09-2006, 04:37 PM   #3
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
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
 
Old 10-09-2006, 04:56 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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.
 
Old 10-09-2006, 05:00 PM   #5
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailing daily logs via cron? ladyath Linux - General 3 03-30-2005 12:51 AM
Problem displaying program output when driven by a cron job garmon Linux - Newbie 1 07-22-2004 03:34 PM
defining an external smtp server for mailing results of chkroot cron job xfurious_mindx Linux - General 0 03-15-2004 10:23 AM
HELP HELP stop cron from mailing plisken Linux - General 2 03-07-2002 01:22 PM
cron mailing to my account plisken Linux - General 1 02-18-2002 06:10 PM


All times are GMT -5. The time now is 09:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration