Print log to an email


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Print log to an email
# 1  
Old 06-19-2008
Print log to an email

Hi,

I have wrote a script and i want to be able to output my variable MSG_DEST (which is a log) to an email. so basically log contains:

hello John

when i email recipient it says

to xxxxxx
from xxxxxx
subject xxxxxx

hello John

What do I need to put in my script to get the log contents on the email?

any help would be appreciated.
# 2  
Old 06-19-2008
I don't quite understand your ques. Is this what you're looking for?
bin/cat $MSG_DEST | /bin/mailx -s "Some log" abc@def.com
# 3  
Old 06-23-2008
Fixed it

I fixed it, thanks any way Incredible.

I did:

mailx -r $MAIL_FROM -s "xxxxxx" $EMAIL < $MSG_DEST
# 4  
Old 06-23-2008
also moved cause no solaris problem. please watch out for the right forum to post!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email backup log

Hi, I have a server which appends to two different backup logs, a summary and a full log, I want to write a script which will email out this mornings backup, the problem is that in the log files the date is in the below format: Fri May 31,2013 02:30 the summary log file I can just use... (6 Replies)
Discussion started by: Bdoydie
6 Replies

2. Shell Programming and Scripting

awk print the body of an email

I have fetched a couple of emails and stored then in /fetch/mail/oracle.txt, the displayed content is Date: From: Subject: To: Content-Type: ---body ----- --------- Date: From: Subject: To: Content-Type: ----body ----- ------ Date: From: I want to retrieve the body only from... (3 Replies)
Discussion started by: maddog21
3 Replies

3. UNIX for Dummies Questions & Answers

Script to print email from defined sender.

Hello all! I'm looking to setup some sort of script so that when a an email comes in from a specific address the message and/or attachments are automatically printed. Any ideas on where to start? Thanks for the help. (9 Replies)
Discussion started by: Mr. Biggz
9 Replies

4. Shell Programming and Scripting

Capture all error message in Log file and send the Log file by email

Hi I have a requirement to write a script to capture all errors in a Logfile and send the file in email. If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS. So I created a Log file and put the Appropriate... (2 Replies)
Discussion started by: dgmm
2 Replies

5. Shell Programming and Scripting

Echo print in different lines within email sent by Cron job

Hi all, I think this could have a simple solution, just I canīt get it so far. I have the script below that includes several echo commands in order to show that every part of the script have been executed. A cron job executes this script and when is completed the output is sent by email. ... (4 Replies)
Discussion started by: cgkmal
4 Replies

6. SCO

Print to Email

Hello I hope someone can help me. As part of an acquisition I have inherited a ERP system running on a SCO 5 server, unfortunately I don't have much Unix knowledge. I have been asked to configure a script so that when users print a report from the ERP software it runs a script that sends the... (1 Reply)
Discussion started by: fishbone56
1 Replies

7. Shell Programming and Scripting

parsing email log

Can anyone give me some examples of how I can parse the following lines of text so that all characters up to and including the @ symbol are deleted? Also, any duplicates would need to be deleted in order to produce the desired output. Any help is much appreciated and explanations of any... (5 Replies)
Discussion started by: jjamd64
5 Replies

8. UNIX for Dummies Questions & Answers

interpreting email log: ndel=

My user claims that some of her email disappeared. I went through the mail log and it seems that she deleted the messages herself from home via webmail. Here are the entries in the mail log: Nov 25 21:27:38 wp5 ipop3d: Login user=somebody@somewhere.com... (1 Reply)
Discussion started by: mstarcom
1 Replies

9. UNIX for Dummies Questions & Answers

where are my email log files

I am trying to find the email log file that would have info on users downloading their pop mail. Our email is hosted on a unix server running apache. I am not sure the exact version of mail software running, but when I telnet to the mail server the response I get is this "+OK POP3 v2003.83rh... (3 Replies)
Discussion started by: mstarcom
3 Replies

10. Shell Programming and Scripting

automated email on a log event

I am monitoring a logfile using tail -f file.log|"ERROR" I would like to write a korn script that monitors this for me and emails me if the event happens. It would be great if it attached the file to the email as well. Any Ideas? (2 Replies)
Discussion started by: seran128
2 Replies
Login or Register to Ask a Question