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
I get the mail ok.
The crontab job works as follows.
(where mailheader contains
To:mymail@account.com
From:batchjob
Subject:batch job log
Body
Then
and finally
When I view the resulting logfile it looks fine.
If at the prompt I execute
I receive it ok.
However, from the crontab job, nothing.
Help.
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
The crontab job works as follows.
Code:
cat mailheader > logfile
To:mymail@account.com
From:batchjob
Subject:batch job log
Body
Then
Code:
runjob >> logfile (where runjob is the batch job)
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
However, from the crontab job, nothing.
Help.