Re: Email inside cron

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > /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.

In your cron script, put "env" command before the mail command.  Send output
to some file.  In your interactive shell, compare output of "env" to cron's
output.  Set environment to that of cron's environment, try to mail
interactively and see if it fails.  If so, add whatever variables are
necessary to make it work, in the cron script.

Another issue with cron is that the standard i/o is different (no tty).
Not yet sure if that's an issue for your situation, or how to go about
working around it, if so.

Regards,
Dan W.
-- 
-- Daniel Widyono                      http://www.cis.upenn.edu/~widyono
-- Liniac Project,     CIS Dept.,    SEAS,    University of Pennsylvania
-- Mail: CIS Dept, 302 Levine     3330 Walnut St  Philadelphia, PA 19104


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux