Email inside cron

Bob Smith bob at netprt.com
Fri Aug 20 15:27:54 UTC 2004


You might consider adding the -b flag to explicity set a source email
address.  You may find that LOGNAME or USER is not set in the cron
environment, and that may be part of the problem.  Try something like
this:

/bin/mail -s "${MsgHeader} finished." ${MailTo} -b ${REAL_USER} < ${logfile}

-Bob


> Hi,
>
> I have a Cshell script that does a whole bunch of stuff and as it is
> doing stuff, it writes status data to a log file. At the end of the
> script I email the contents of the log file to me email address as
> follow:
>
> /bin/mail -s "${MsgHeader} finished." ${MailTo} <${logfile}
>
> This works fine when I run the script interactively, but no email is
> sent when I run ut as a cron job.
>
> Any ideas why?
>
> Thanks
>
> --
> redhat-list mailing list
> unsubscribe
> mailto:redhat-list-request at redhat.com?subjecthttps://www.redhat.com/mailman/listinfo/redhat-list
>





More information about the redhat-list mailing list