Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need in for a script that should check for errors in multiple log file (approx 2500) and should mail Post 302996407 by Pratik_CTS on Tuesday 25th of April 2017 07:32:14 PM
Old 04-25-2017
Need in for a script that should check for errors in multiple log file (approx 2500) and should mail

hello everyone,

I am new to linux and got this deliverable to write a script that should check for error in multiple log file (count is approx 2500 log files on single server) and once error is found, it should mail that error

My logic says:
we can put all log files path/location in one FILE and we can implement for loop to read single file from FILE and search for error and if error is found , will append in different output file and iterating for loop to read every log file in FILE and once all files are searched, then mailx output file

Could you please help me in implementing above idea or if you have any convenient way, please share.

Looking for help from scriptors

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Schedule a script to check mail?

Hi, I'd like to somehow schedule a task on my webserver, such that my account's mail is checked every 10-15 minutes and: a) any new e-mails received from a particular address are POST-ed to a PHP webpage on my server. b) any new e-mails received from a different particular address are... (2 Replies)
Discussion started by: stujones
2 Replies

2. Shell Programming and Scripting

check the file in multiple Directory in a script

hi, i want to write the script to list atleast one file inside that directory eg: /home/Log/amp01 /home/log/amp02 . . . /home/log/amp..N want to see atleast one file inside the /home/log/amp01 .... amp(N) if it not there.. need to give that no file exists inside... (3 Replies)
Discussion started by: mail2sant
3 Replies

3. Shell Programming and Scripting

How to automatically send a mail alert if the script errors out

I have a script like this, which calls other scripts from that script: #!/usr/ksh moveFiles.sh extract.sh readfile=/home/sample.txt cat $readfile | while read line do file= `echo $line|awk '{print $4}'` if ; then mv $file /home/temp_stage fi (4 Replies)
Discussion started by: ss3944
4 Replies

4. Shell Programming and Scripting

Need script to pull multiple field from log file

I am hoping to get some help with a script to pull certain fields from a log file. User update (xx6xxx P) rpt (yy6yyy B) 2010/01/20 21:36:01.298 Remote client forward start streamid 85af 2010/01/20 21:36:01.307 rpt2 (ZZ6ZZZ G) rpt1 (YY6YYY B) urcall (CQCQCQ ) mycall (W1AW) user... (5 Replies)
Discussion started by: TedSD
5 Replies

5. Shell Programming and Scripting

Shell script for creating log file and sending mail?

Hi , I am trying to create shell script which will help me to compare file name in two folder. There is a multiple file store in 2 folder.I want to compare that with the name. If all the file are same then send a mail that "all date is same" if not then create one log file which contain... (4 Replies)
Discussion started by: san_dy123
4 Replies

6. Shell Programming and Scripting

File check script fails for multiple files

I want to check if any file with testing*.txt exists but my script fails if more than 1 file exists. It works fine for a single file if then echo "TEST21" fi -------------- bash: How do I fix this? Thanks Please use code tags next time for your code and data. (8 Replies)
Discussion started by: sumang24
8 Replies

7. UNIX for Dummies Questions & Answers

Check file size and mail

Hi, I am trying to write a script which will check if the filesize is grather than 0 KB, compress the file and send to the email list else if the file size is zero KB don't send a mail update the log if then echo "Validate the file" | mailx -s " There are errors : " ${EMAIL_LIST} else... (5 Replies)
Discussion started by: mora
5 Replies

8. Shell Programming and Scripting

How to catch errors in a shell script ( multiple commands )?

Hi I have a shell script like that Main() { DAY=$(date +"%d-%m-%Y") TIME=$(date +"%T") Command 1 Command 2 ... Command n } I would like to catch errors from all commands in Main() and write these errors into a file , something likes this: Main if < error > then echo... (3 Replies)
Discussion started by: bobochacha29
3 Replies

9. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies

10. Shell Programming and Scripting

Check file if not found send mail if exit call second script

I need to check my script and change to working mode. currently it was not sending the mail and exit without calling the second script. I need to check the file is present ="/home/Rvtools/test.csv" if this file not found after the time retry send mail file not found If the file exit run the... (2 Replies)
Discussion started by: ranjancom2000
2 Replies
APPROX.CONF(5)							File Formats Manual						    APPROX.CONF(5)

NAME
approx.conf - configuration file for approx proxy server SYNOPSIS
/etc/approx/approx.conf DESCRIPTION
Each non-blank line of the configuration file should contain a name/value pair, separated by white space. Comments start with a "#" char- acter and continue to the end of the line. Names that begin with the "$" character are reserved for use as configuration parameters. The following parameters are currently defined: $cache Specifies the location of the approx cache directory (default: /var/cache/approx). It and all its subdirectories must be owned by the approx server (see also the $user and $group parameters, below.) $interval Specifies the time in minutes after which a cached file will be considered too old to deliver without first checking with the remote repository for a newer version (default: 60) $max_rate Specifies the maximum download rate from remote repositories, in bytes per second (default: unlimited). The value may be suffixed with "K", "M", or "G" to indicate kilobytes, megabytes, or gigabytes per second, respectively. $max_redirects Specifies the maximum number of HTTP redirections that will be followed when downloading a remote file (default: 5) $user, $group Specifies the user and group that owns the files in the approx cache (default: approx) $syslog Specifies the syslog(3) facility to use when logging (default: daemon) $pdiffs Specifies whether to support IndexFile diffs (default: true) $offline Specifies whether to deliver (possibly out-of-date) cached files when they cannot be downloaded from remote repositories (default: false) $max_wait Specifies how many seconds an approx(8) process will wait for a concurrent download of a file to complete, before attempting to download the file itself (default: 10) $verbose Specifies whether informational messages should be printed in the log (default: false) $debug Specifies whether debugging messages should be printed in the log (default: false) The other name/value pairs are used to map distribution names to remote repositories. For example, debian http://ftp.debian.org/debian security http://security.debian.org TCP PORT NUMBER
The port on which approx(8) listens is not specified in this file, but in /etc/inetd.conf. The default value is 9999, for compatibility with apt-proxy(8), but it may be changed by running the command dpkg-reconfigure approx SEE ALSO
approx(8), approx-gc(8), inetd(8) AUTHOR
Eric Cooper <ecc@cmu.edu> Apr 2012 APPROX.CONF(5)
All times are GMT -4. The time now is 12:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy