Sponsored Content
Top Forums Shell Programming and Scripting How pull the Data from the file and should be mailed Post 302403852 by raghunsi on Monday 15th of March 2010 02:14:29 AM
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

 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
PULL-LP-SOURCE(1)					      General Commands Manual						 PULL-LP-SOURCE(1)

NAME
pull-lp-source - download a source package from Launchpad SYNOPSIS
pull-lp-source [options] source package [release|version] DESCRIPTION
pull-lp-source downloads and extracts the specified version of <source package> from Launchpad, or the latest version of the specified release. To request a version from a particular pocket say release-pocket (with a magic -release for only the release pocket). If no ver- sion or release is specified, the latest version in the development release will be downloaded. OPTIONS
Listed below are the command line options for pull-lp-source: source package This is the source package that you would like to be downloaded from Launchpad. version This is the version of the source package to be downloaded. release This is the release that you would like the source package to be downloaded from. This value defaults to the current development release. -h, --help Display a help message and exit. -d, --download-only Do not extract the source package. -m UBUNTU_MIRROR, --mirror=UBUNTU_MIRROR Use the specified Ubuntu mirror. Should be in the form http://archive.ubuntu.com/ubuntu. If the package isn't found on this mir- ror, pull-lp-source will fall back to Launchpad, as its name implies. --no-conf Do not read any configuration files, or configuration from environment variables. ENVIRONMENT
All of the CONFIGURATION VARIABLES below are also supported as environment variables. Variables in the environment take precedence to those in configuration files. DIST Specifies the default target. CONFIGURATION VARIABLES
The following variables can be set in the environment or in ubuntu-dev-tools(5) configuration files. In each case, the script-specific variable takes precedence over the package-wide variable. PULL_LP_SOURCE_UBUNTU_MIRROR, UBUNTUTOOLS_UBUNTU_MIRROR The default value for --mirror. SEE ALSO
dget(1), pull-debian-source(1), pull-debian-debdiff(1), ubuntu-dev-tools(5) AUTHOR
pull-lp-source and this manual page were written by Iain Lane <iain@orangesquash.org.uk>. Both are released under the GNU General Public License, version 3 or later. ubuntu-dev-tools 4 August 2008 PULL-LP-SOURCE(1)
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy