Sponsored Content
Full Discussion: Exclude string
Top Forums Shell Programming and Scripting Exclude string Post 302933626 by ust3 on Saturday 31st of January 2015 08:12:11 PM
Old 01-31-2015
Quote:
Originally Posted by Scrutinizer
You could have a file with the server names and try something like this (not tested):


Code:
while read server
do
  ssh "$server" cat logfile
done < file_with_servernames | grep -vFf exclude_list.txt > /tmp/filtered_log

if messages=$(grep -Ff include_list /tmp/filtered_log); then
  echo "$messages" | mailx ....
fi

thanks reply ,
the above script is check remote server log , it seem check 1 server only , right ?
if I want to access 10 servers to check its log , would advise how to do it ? thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Getting 'tar' to exclude

I want 'tar' to exclude certain dir's. tar cvf ............. ............ does the whole lot, but I want to exclude the 'log' dirs. (6 Replies)
Discussion started by: kuultak
6 Replies

2. UNIX for Dummies Questions & Answers

Exclude list

Hi, I am trying to exclude "/web" directory from a server. I am able to login to the server, and this is the command it gives me: $ /usr/openv/netbackup/exclude_list bash: /usr/openv/netbackup/exclude_list: No such file or directory can anyone pls help me :confused: (3 Replies)
Discussion started by: decamposem
3 Replies

3. SCO

Tar exclude

Hi, We work on a UNIX SCO SCO_SV Release = 3.2v5.0.5. I have a folowing structure /u/usr/lpp /u/usr/lpp/SQL /u/usr/lpp/DIR2 I use following tar to backup the /u/usr/lpp directory cd /u/usr/lpp tar cvf /u/usr/backup/backup.tar . Now I want to exclude the subdirectory SQL. I... (2 Replies)
Discussion started by: haezeban
2 Replies

4. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

5. Shell Programming and Scripting

Exclude a file or not in

Hi Gurus. I have a directory and i receive many files with extension .log. I processed the file as i get it. i want to process all the files except one which i know i don't want to process. cd /backup/temp/rajesh/PACS #--- directory , under this i have below files... (1 Reply)
Discussion started by: guddu_12
1 Replies

6. Shell Programming and Scripting

To exclude a string from monitoring

Hi below is my current scripting which will monitor for any errors in the application logfile="/tmp/application.log" output=$(grep "ERROR" $logfile) if then echo "found- send email" else echo "not found" fi Now I wanted the script not to send the email for one of the... (12 Replies)
Discussion started by: ajothi
12 Replies

7. Shell Programming and Scripting

Exclude files in ls

Hi, I need to exlucde the files which are present in exclude.txt from a directory exlcude.txt AUZ.txt AUZ.chk NZ.txt NZ.chk tried with below code but not working ls -ltr | grep -v `cat exclude.lst` (9 Replies)
Discussion started by: rohit_shinez
9 Replies

8. Shell Programming and Scripting

Exclude certain folders

Hi Experts, Below is my shell script and it will move the files older than 90 days to archive mount. Now my new requirement is , I need to move some of the directory files older than 365 days. How can I achieve this. Simply I have DIR1 DIR2 DIR3 DIR4 I need to exclude DIR 2 and DIR 2... (5 Replies)
Discussion started by: arumugavelvelu
5 Replies

9. UNIX for Dummies Questions & Answers

Du exclude in Solaris

How do you exclude a filesystem using du command in solaris? for example /proc Tried this but its not working du -sk -d /* --exclude=/proc | sort -nr | cut -f2 | xargs du -sh | head - in linux it is working. (2 Replies)
Discussion started by: jinslick25
2 Replies

10. Shell Programming and Scripting

Du exclude in Solaris

How do you exclude a filesystem using du command in solaris? for example /proc Tried this but its not working du -sk -d /* --exclude=/proc | sort -nr | cut -f2 | xargs du -sh | head - (1 Reply)
Discussion started by: jinslick25
1 Replies
CONTROL.CTL(5)							File Formats Manual						    CONTROL.CTL(5)

NAME
control.ctl - specify handling of Usenet control messages DESCRIPTION
The file <pathetc in inn.conf>/control.ctl is used to determine what action is taken when a control message is received. If <usecon- trolchan in inn.conf> is ``true'', it is read by the controlchan script, which can be invoked as channel program by innd(8). When con- trol.ctl is modified, controlchan notices this automatically and reload it. If <usecontrolchan in inn.conf> is ``false'', it is read by the parsecontrol script, which is called by all the control scripts. (For an explanation of how the control scripts are invoked, see innd(8).) The file consists of a series of lines; blank lines and lines beginning with a number sign (``#'') are ignored. All other lines consist of four fields separated by a colon: message:from:newsgroups:action The first field is the name of the message for which this line is valid. It should be either the name of the control message or the word ``all'' to mean that it is valid for all messages. The second field is a shell-style pattern that matches the email address of the person posting the message. (The poster's address is first converted to lowercase.) The matching is done using the shell's case statement (or the equivalent); see sh(1) for details. If the control message is ``newgroup'' or ``rmgroup'' then the third field specifies the shell-style pattern that must match the group being created or removed. If the control message is ``checkgroups'' then the third field specifies the shell-style pattern that is used to determine which newsgroups are processed for checking. If the control message is of a different type, then this field is ignored. The fourth field specifies what action to take on control messages that match this line. The following actions are understood: doit The action requested by the control message should be performed. In some cases, the control script will also send mail to <USER specified with --with-news-master at configure>, but if notification of the action should always be sent, doit=mail should be used instead (see below). doifarg If the control message has an argument, this is treated as a ``doit'' action. If no argument was given, it is treated as a ``mail'' entry. This is used in ``sendsys'' entries script so that a site can request its own newsfeeds(5) entry by posting a ``sendsys mysite'' article. On the other hand, sendsys ``bombs'' ask that the entire newsfeeds file be sent to a forged reply-to address; by using ``doifarg'' such messages will not be processed automatically. (Processing ``sendsys'' control messages is still not recom- mended, even with this work-around, unless they are authenticated in some fashion. The risk of having news servers turned into anonymous mail bombing services is too high.) doit=file The action is performed, but a log entry is written to the specified log file, file. If file is the word ``mail'' then the record is mailed. A null string is equivalent to /dev/null (in other words, with a null string, nothing is logged). A pathname that starts with a slash is taken as the absolute filename to use as the log. Otherwise, the log entry is written to <pathlog in inn.conf>/file.log. The log is written by writelog (see newslog(8)). drop No action is taken; the message is ignored. verify-* If the value starts with the string ``verify-'' (for example, ``verify-news.announce.newgroups'') then PGP verification of the con- trol message will be done using the key issued by the ``user'' defined by the rest of the string -- ``news.announce.newsgroups'' in this example. If no logging is specified (with =file mentioned below), notification of successful ``newgroup'' and ``rmgroup'' mes- sages and the output of ``checkgroups'' messages will be mailed to the news administrator. verify-*=file PGP verification is done as for the ``verify-*'' entries, and a log entry is written to the specified file. (In the case of ``checkgroups'' messages, this means the shell script output of the ``checkgroups'' message will be written to that file.) log A one-line log notice is sent to standard error. innd(8) normally directs this to the file <pathlog in inn.conf>/errlog. log=file A log entry is written to the specified log file, file, which is interpreted as described above. mail A mail message is sent to the news administrator. Processing of a ``checkgroups'' message will never actually change the active(5) file. The difference between an action of doit (or ver- ify) and an action of mail for ``checkgroups'' control messages lies only in what mail is sent; doit will mail the news administrator a shell script to create, delete, or modify newsgroups to match the ``checkgroups'' message, whereas mail will just mail the entire message. In either case, the news administrator will have to take action to implement the ``checkgroups'' and if the mail is ignored, nothing will be changed. Lines are matched in order; the last match found in the file is the one that is used. For example, with the following three lines: newgroup:*:*:drop newgroup:group-admin@isc.org:comp.*|humanities.*|misc.*|news.*| rec.*|sci.*|soc.*|talk.*:verify-news.announce.newgroups newgroup:kre@munnari.oz.au:aus.*:mail A newgroup coming from ``group-admin'' at a ISC machine will be honored if it is one of the listed hierarchies and if it has a valid signa- ture with the ``news.announce.newgroups'' key. If ``kre'' posts a newgroup message creating ``aus.foo'', then mail will be sent. All other newgroup messages are ignored. Use of the verify action for processing ``newgroup'', ``rmgroup'', and ``checkgroups'' messages is strongly recommended. Abuse of control messages is rampant, and authentication via PGP signatures is currently the only reliable way to be sure that a control message comes from who it claims to be from. Most major hierarchies are now using PGP-authenticated control messages. In order to use verify actions, the PGP key ring of the news user must be populated with the PGP keys of the hierarchy maintainers whose control messages you want to honor. For more details on PGP-authenticated control messages and the URL for downloading the PGP keys of major hierarchies, see pgpverify(8). Control messages of type ``cancel'' are handled internally by innd(8) and cannot be controlled by any of the mechanisms described here. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.11.2.1, dated 2000/08/17. SEE ALSO
controlchan(8), inn.conf(5), innd(8), newsfeeds(5), pgpverify(8), scanlogs(8). CONTROL.CTL(5)
All times are GMT -4. The time now is 06:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy