Sponsored Content
Full Discussion: Regarding mailing of logs
Top Forums UNIX for Dummies Questions & Answers Regarding mailing of logs Post 302648221 by SankalpS on Tuesday 29th of May 2012 12:44:41 PM
Old 05-29-2012
Hi joeyg,
Thanks a lot, Perfect explanation for a beginner , please advise

1) I do not any more need to do the cd command to reach the location , when I login through putty I am at the root , at this I should go as per your advise command

Code:
uuencode /var/logs/abc.log | mailx -s "logs requested" sankalps@1somewhere.com

Now if first I should try this command , if it works then it would immediately mail me abc.log at my inbox on sankalps@1somewhere.com
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mailing an attachment

Hi, I'm fairly new to using Unix and I was just wondering can someone please tell me the simplest way to mail and attachement using the mail command using Solaris? I have tried using uuencode file name | mail johndoe@ttp.ie but it hasn't worked. I have been mailing the file to myself using... (4 Replies)
Discussion started by: gerwhelan
4 Replies

2. UNIX for Dummies Questions & Answers

Mailing an attachment

Hi, I need to compress (zip) a flat file and mail the same as an attachment. I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters). tar cf abc.tar abc.txt compress abc.tar uuencode abc.tar.Z abc1.wri | mailx... (4 Replies)
Discussion started by: gayath3
4 Replies

3. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

4. Shell Programming and Scripting

Mailing script

Hi, I have a file lets say FILE1. FILE1 ------ name,age charlie,25 harry,29 david,32 Pls help me writing a mailing script.... which will mail the content of file in the body of the mail & it will look something like below in two columns. name age charlie 25 harry 29... (1 Reply)
Discussion started by: 46019
1 Replies

5. Shell Programming and Scripting

issue with mailing

hi i run a mailing script daily using rsh i receive the mail sometimes but sometimes receive the permission denied error. could not understand the cause of permission denied because it sometimes runs properly and i am able to receive the mail Please Advice (4 Replies)
Discussion started by: mad_man12
4 Replies

6. Shell Programming and Scripting

HTML mailing

Hi All, I have a comma separated file as below. file-1 ---------- a,b,c d,e,f g,h,i . . . I want to send the above file in Mail in HTML format with all the values of each column in separate cells i.e. the body of the mail should be in tabular format & each field should be separate... (2 Replies)
Discussion started by: 46019
2 Replies

7. UNIX for Dummies Questions & Answers

Mailing in unix

is there any option to mail the value from top command directly to the user.. i want the value of cpu usage from six different servers to be send in a single mail.. thanks, Arun Manas:b: (3 Replies)
Discussion started by: arunmanas
3 Replies

8. Shell Programming and Scripting

Mailing Script

Hi, I am totally New to This Scripting Area.We have developed some reports in Bo and User need those reports to be sent through Unix Server (SFTP). Can any one provide me script for transfering File from one location to other with the requirement like if that file fails to reach destination... (4 Replies)
Discussion started by: Sashanth_S
4 Replies

9. UNIX for Advanced & Expert Users

Regarding mailing of logs

Hi Folks, I have an application which logs get continuously refreshed and made after every 1 second , I want that those logs get mailed to me at my email id sara@somewhere.com The location is cd /var/log/abc/log Please advise the command so that I can mail abc.log at my mailid inbox... (2 Replies)
Discussion started by: SankalpS
2 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
FILTER(1)						      General Commands Manual							 FILTER(1)

NAME
filter - filter incoming messages before adding to mailbox SYNOPSIS
filter [-q] [-v] [-l] [-o output] [-f rules-file] [-m mailbox] filter [-n] [-f rules-file] filter [-r] [-o output] [-f rules-file] filter [-c] [-s] [-o output] [-f rules-file] filter [-c] [-S] [-o output] [-f rules-file] DESCRIPTION
In brief, filter is designed to sort incoming mail based on user preferences for various recognized headers. It logs a summary of messages filtered to a logfile. See the USAGE section for full details. OPTIONS
The flags the filter program understands are; -c Clear logs. If this flag is used, the log files will be removed after being summarized by either "-s" or "-S" (see below). -f rules-file Get rules from specified file instead of default $HOME/.filter/filter-rules -l Log actions only. Do not log information about mailed messages. -n Not really. Output what would happen if given message from standard input, but don't actually do anything with it. -o file Redirect stdout messages to the specified file or device. Logging of filter actions is not affected. (This is added to more gracefully deal with changes in the file system (since sendmail is quite picky about modes of files being redirected into.)) -m mailbox Override the compiled in definition of your primary 'mailbox'. This is disabled if filter is setgid. -q Quiet. Do not log filtering actions. -r Rules. List the rules currently being used. -s Summarize. List a summary of the message filtering log. -S This is the same as `-s' but includes message-by-message information additionally. -v Verbose. Give output on standard out for each message filtered. May be useful to set output to ``/dev/console'' or other log- ging device. (see -o). USAGE
Filter uses a set of selection rules to process incoming mail messages. These rules are normally read in from $HOME/.filter/filter-rules. As soon as a rule matches something about the message, that rule is used, and no further action is taken. The general format for a rule is; if (expression) then action where expression is: expression ::= { not } condition { and expression } condition ::= field = stringvalue ::= field != stringvalue ::= lines relop numvalue or ::= always These further break down as: field ::= from | subject | alphasubject | to | lines | sender relop ::= = | != | < | > | <= | >= stringvalue ::= any quoted string numvalue ::= any integer value Note: alphasubject is a transformed version of the subject line, where only alpha chars are preserved, and they are forced to lower case. It is then simpler to use a regular expression match across a wide variety of similar subjects. from matches any and all of the following headers: "From " From: Reply-To: Sender: Action can be any of: delete (ignore this message; throw it away) save foldername (put in 'foldername' for later) savecopy foldername (save a copy AND put in my inbox) execute command (pipe message to 'command') executec command (copy to inbox, AND pipe to 'command') forward address (forward this message) forwardc address (forward this message, AND copy to inbox) resend address (resend to new addr without change) leave (just put it in my inbox) bounce (say there's no such user) An example of a rules file would be: # I'll read this stuff later when I feel like it if (from = "list@interest.org") then save "~/Mail/mailinglist" # This mailing list actually has an x-mailing-list header if (mailinglist = "smartlist@other.com") then save "~/Mail/otherlist" # auto-archive this project's email, AND put in my current mailbox if (subject = "strange project") then savecopy "~/Mail/proj-archive" # If "make money" appears ANYWHERE in subject, upper/lowercase, # delete the lousy spam if ( subject = "make money" ) then delete # This person no longer shares this virtual mailbox with me. # Resend visibly as a "forwarded" message. if (to = "partner") then forward "partner@new.address.com" # If email for an old address comes to me, resend to new one. # Note that the "envelope" will show my address, but the # normal headers will not if ( to = "old_address" ) then resend new@address.here" # Special virtual headerline derived from normal subject line # catches "multiple!!!wor+ds**here" if ( alphasubject = "multiplewordshere" ) then delete # If email for a special address comes to me, resend through # a non-standard "special" mailer if ( to = "special_address" ) then exec "/usr/lib/mailer special@addr" # # The rules file doesnt really need parentheses. Or even the 'if'. # They are just traditional. subject = "silly" then bounce Note that all filenames must be double-quoted For further information about the rules language, please see The Elm Filter Guide. MAINTAINER
Philip Brown FILES
$HOME/.filter/filter-rules Default rules file $HOME/.filter/filterlog A log of what has been done $HOME/.filter/filtersum A summary of what has been done $MAIL IF you set this var, defines your default mailbox /etc/passwd Used to get users home directory SEE ALSO
The Elm Filter Guide (distributed with the source code) mail(1), mailx(1), sendmail(1,8) COMMENTS
Could be smarter about pattern matching. Message body checks might be nice too. Please note that this was historically bundled with the elm mail reader, but now can be found at http://www.bolthole.com/filter/ BUG REPORTS TO
filter@bolthole.com COPYRIGHTS
Copyright 1988-1992 by The USENET Community Trust Derived from Elm 2.0, Copyright 1986, 1987 by Dave Taylor USENET Comm. Trust 19 April 2004 FILTER(1)
All times are GMT -4. The time now is 11:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy