How pull the Data from the file and should be mailed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How pull the Data from the file and should be mailed
# 1  
Old 03-15-2010
How pull the Data from the file and should be mailed

Hi All,

I need to pull the data from a file from 2 set of directories & should be mailed.
I have a code , it is failing for some reason. Do somebody correct me where my script is going wrong.

Directories:

1st Set of Directory /176_PS/Transactions/**/syslog.log

** : prd1
prd2
prd3

2nd Set of Directory /176_TS/Transactions/**/syslog.log

** : tst1
tst2
tst3

Code:
#!/bin/bash
#Script to Pull the Missing Elements of 176s

while [ true ]
do
hour=`date +%H`
minute=`date +%M`
seconds=`date +%S`
if [ "$minute" == "41" ] && [ "$second" == "00" ]
then
  cd /
  grep "missing document  " /176S_*/Transactions/**/system.log | cut -d\/ -f4 | sort| uniq -c | mail -x myself@dot.com
fi
sleep 1
done

# 2  
Old 03-15-2010
Put the script in cronjob, and grep directly.
# 3  
Old 03-15-2010
Dont have access for crontab, Im just a user.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I use grep to pull incremental data and send to multiple files?

Hi Everyone, Im currently using the below code to pull data from a large CSV file and put it into smaller files with just the data associated with the number that I "grep". grep 'M053' test.csv > test053.csv Is there a way that I can use grep to run through my file like the example below... (6 Replies)
Discussion started by: TheStruggle
6 Replies

2. Shell Programming and Scripting

Cpu utilization by a process has to be mailed if more than 5% on AIX

i am using the below command in order to find the cpu utilization by a user..now i want to mail if the cpu utilization goes beyond 5%....can someone please help me ? ps auxw | sort -r +2 | awk '{ print $3,$1 }' | head -6 | egrep "USER|#anonymous#" %CPU USER 2.0 anonymous Regards,... (6 Replies)
Discussion started by: arorap
6 Replies

3. Shell Programming and Scripting

Trying to pull a variable out of an xml file...

Hello. I'm new to *ix and am trying to pull a variable or two from an xml document. The document is in the format: <name>7_3(A).mov</name> <description>Some description from a file</description> <updatename>7_3_A.mov</updatename> <updatepath>Dailies Released</updatepath> ... (3 Replies)
Discussion started by: Renfield
3 Replies

4. Shell Programming and Scripting

Pull Data After Comma if 2 word before comma

Hi, I am trying to truncate word after comma in a file ONLY if there are already 2 words BEFORE comma. If there is one word or 3 or more words BEFORE comma, then I have to leave the data AS IS. See below for example. Input File : John Smith, Manager Smith, John Frank J F K... (2 Replies)
Discussion started by: msalam65
2 Replies

5. Shell Programming and Scripting

Pull specific data from repetitive text?

Hi all, I have a bit of a problem with a loop that extracts repetitive text. Running /bin/index executable outputs this text to terminal: testing index 'scanthread'... collected 0 docs, 0.0 MB total 0 docs, 0 bytes total 0.012 sec, 0 bytes/sec, 0.00 docs/sec testing index 'scanpost'...... (6 Replies)
Discussion started by: TECK
6 Replies

6. Shell Programming and Scripting

How do you use pull data from multiple lines to do a for statement?

Guys I am having a problem with being able to find missing monitors in a configuration check script I am trying to create for accountability purposes for managing a large number of systems. What I am trying to do is run a script that will look at the raw config data in a file and pull all the pool... (7 Replies)
Discussion started by: scottzx7rr
7 Replies

7. Shell Programming and Scripting

How do I pull a substring out of a file?

I'm new to shell scripting and am trying to write a small script that pulls a substring out of a file that has a few lines of text in it. The file will eventually have a lot of text, I just put a few lines in it for testing purposes. Anyway, this is what I have so far... #!/bin/ksh ... (4 Replies)
Discussion started by: enator45
4 Replies

8. UNIX for Dummies Questions & Answers

Using awk (or whatever) to pull and append data in a new file

One of the fortunate things about posting in a "Dummies" forum is you probably aren't expecting a lot of out me... I'm trying to pull fields from two lines in the same file(s), and then append them together in a new file. So...I get a nice line-by-line of the first bit of data I'm looking... (6 Replies)
Discussion started by: Milano_EH3
6 Replies

9. Shell Programming and Scripting

Logfiles E-mailed

Hi All There are some cron jobs ,which runs 24 hrs. Log files are generated when one job fails. So I need the log files to be emailed to my personal e-mail id. So that I can see the log files at my home If there is any error. How can I implement this in Unix shell programming. Thanks... (4 Replies)
Discussion started by: deep_kol
4 Replies

10. Shell Programming and Scripting

Prevent file from being mailed multiple times from a job

We have a ksh which runs once every 15 minutes. Based on a certain condition (for invalid data) we are spooling a file and if the file is of length greater than 0 bytes, then we are mailing this file to a group of users. Upon receiving the file, users correct the data so that on its next run the... (2 Replies)
Discussion started by: Sree_2503
2 Replies
Login or Register to Ask a Question