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
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
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
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
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
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
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
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
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
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
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