This is great, I have been doing this for some years now, but recently
discovered this:

uuencode /root/weekly.log weekly_log.txt > /root/weekly_log ; mail -s
"Weekly logs" [EMAIL PROTECTED] </root/weekly_log

This attaches the log file as a file, and does not place it in the body of
the text. You could change the line to this, and it will then give you
some text in the body of the message. I use this on our MRP system
to see if the control records balance. I grep out the various values from
the reports, and display them in the body of the message. If all is well,
I need not read the file. If the figures don't balance, I then start
digging - This has saved me plenty of time, all I do is browse the 
subject line of my e-mail for any funnies.

<--------- Script Start ------------->

SUBJECT="Differences Found"
VALUE1="Grep values from log file you want"
VALUE2="Grep values from log file you want"
[ "$VALUE1" = "$VALUE2" ] && SUBJECT="No differences"
echo -e "Message for body of e-mail\n Value1=$VALUE1\n Value2=$VALUE2" > 
/root/weekly_log
uuencode /root/weekly.log weekly_log.txt >>/root/weekly_log
mail -s "Weekly Logs - $SUBJECT" [EMAIL PROTECTED] </root/weekly_log

<------------ Script End ------------>

Regards
Enrico

On Mon, 16 Apr 2001, Hal Burgiss wrote:

> On Mon, Apr 16, 2001 at 10:32:27AM -0400, digitalfrontier wrote:
> > Im using the mail command to send me my some log files every week...but when
> > i get the email, the files are not sent,..here is the command line i used:
> > 
> > mail -s "weekly logs" < /root/weekly.log [EMAIL PROTECTED]
> > 
> > am i missing something here?...why its the file not being sent with the
> > email?
> 
> Try it like:
> 
>  mail -s "weekly logs"  [EMAIL PROTECTED] < /root/weekly.log
> 
> 

-- 



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to