Send File.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Send File.
# 1  
Old 02-01-2011
Send File.

Hello There!

What i'm trying to accomplish is...

(1) Anytime i monitor the logs, the logs generated at that minute will be redirected to a temporary file(error).
Code:
more wl-domain.log | grep `date +%H:%M:` >> $error

(2) And i'm checking the word count of the file, assuming that increase in the count more than 22 had logged the grepped string.

Code:
a=`cat errorfound.txt | wc -l`

(3) If logged so, i should get an alert.

(4) By default the file has 22 lines, So if anything apart from that gets logged the count increased obviously... So, i used a comparision here to make the difference to get an alert.

Code:
if [ $a -gt $b ]
then
cat /opt/app/bea/wli81sp6/user_projects/domains/tsliptDomain/bhargavk/errorfound.txt | mailx -s "Alert!!!" $TO
fi

Now the issue is, even if the particular parrern is not generated, i'm getting alert. Smilie
# 2  
Old 02-02-2011
Hi,

I got the resolution for this. Thanks to 'Chris F.A. Johnson'. From one of his post i come to know about the new opperend 'newer' and with help of that i've compared the newer file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send file with Linux

Hi, I have scripts on AIX which send mails by the following command : cat MyFile | mail -s "mail subject" adress@mail these scripts send a text directly readable in the body of the mail We are now in CENTOS 7 , and the same command , send the mail, but instead of receiving the readable... (4 Replies)
Discussion started by: tbeghain
4 Replies

2. Shell Programming and Scripting

Read file data and send to different file

junk.txt has a single numerical value in it, let's say 50421.44. over.namelist has lots of expressions in it, but somewhere random it says value = x.x I need to go into junk.txt, pull out the number, and amend over.namelist to say value = 50421.44. :(:( I'm trying to use sed, but... (5 Replies)
Discussion started by: jammyjames
5 Replies

3. Shell Programming and Scripting

Bash script to send lines of file to new file based on Regex

I have a file that looks like this: cat includes CORP-CRASHTEST-BU e:\crashplan\ CORP-TEST /usr/openv/java /usr/openv/logs /usr/openv/man CORP-LABS_TEST /usr/openv/java /usr/openv/logs /usr/openv/man What I want to do is make three new files with just those selections. So the three... (4 Replies)
Discussion started by: newbie2010
4 Replies

4. Shell Programming and Scripting

Remove bad records from file and move them into a file then send those via email

Hi my requirement is that i want pull the bad records from input file and move those records in to a seperate file. that file has to be sent via email.. any suggentions please (1 Reply)
Discussion started by: sxk4999
1 Replies

5. Shell Programming and Scripting

Read the lines within file and send each line to different new file

I need help.....I have number of data files and I need to read the contains of each file which is three lines by awk commands or script, and send each line within the data file to different new file . That means I will have three files as a result, the first file will contains the first lines for... (4 Replies)
Discussion started by: aldreho
4 Replies

6. UNIX for Advanced & Expert Users

Converting .csv file into .xls file and send it to inbox

Hi All, I wrote a script to extract data from Oracle DB and place it in a text file , and I have coverted .txt file into comma seperated .csv file and I sent it to my mail box . I can get .xls file in my inbox.I am getting all data in same column and in different rows , without column... (1 Reply)
Discussion started by: krthkmuthu
1 Replies

7. UNIX for Advanced & Expert Users

send attachments using send mail in Solaris

Hi All, I have a requirement to send and email of body html with an attachment. concatinating uuencode output to the mail body with mailx command works, but as my Email body is of HTML type i use sendmail. my command to send HTML body is as below: export MAILTO="recipient@domain.com"... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies

8. Shell Programming and Scripting

capture output of file and send last string thereof to new file

Hello, If I run a program from within shell, the output is displayed in the command line terminal. Is there a way I can capture that output and choose only the very last string in it to send it to a new file? Thank you (6 Replies)
Discussion started by: Lorna
6 Replies

9. UNIX for Dummies Questions & Answers

How do I send a file

Hi, I'm literally just starting to learn UNIX and don't know how to transfer a file from my computer to my website. Can anyone help? Thanks (1 Reply)
Discussion started by: agalove
1 Replies

10. UNIX for Dummies Questions & Answers

How do I send a file as an attachment (gzip file) on a Unix system

Hi, How do I send a file as an attachment (gzip file) on a Unix system ? Using sendmail. Please help me. :confused: (3 Replies)
Discussion started by: lacca
3 Replies
Login or Register to Ask a Question