Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get sendmail to work from crontab job.

Status
Not open for further replies.

Calum433

Programmer
Feb 27, 2002
1
GB
I have a job run by crontab which produces a log file.
I want the job to email me the log file on completion.
sendmail works and if at the prompt I enter
Code:
/usr/sbin/sendmail -t < logfile
I get the mail ok.

The crontab job works as follows.
Code:
cat mailheader > logfile
(where mailheader contains
To:mymail@account.com
From:batchjob
Subject:batch job log
Body:)

Then
Code:
runjob >> logfile (where runjob is the batch job)
and finally
Code:
/usr/sbin/sendmail -t < logfile

When I view the resulting logfile it looks fine.
If at the prompt I execute
Code:
/usr/sbin/sendmail -t < logfile
I receive it ok.
However, from the crontab job, nothing.
Help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top