Hello everyone, I'me new to shell scripting and have been trying to create a custom script to do the following steps -
1. search for the word servicedown within all log files in a specific directory
2. After finding the keyword servicedown, grab latest timestamp from that log
3. Set variable with results from #2
4. loop previous log files and grab the timestamp from the last line from next newest log in that directory.
5. Set a variable with the results from #4
5. Calculate difference between the 2 timestamps in minutes.
Here is what I have so far, and it's very incomplete. I've been trying to piece this script together as best as I can and could really use any help I can get.
Please make it emphatically clear where to find "timestamp", stating the units, layout and precision of "timestamp".
I may be being thick, but I can't see any code to save the timestamp of the "servicedown" event or to save the timestamp of the logfile prior to the event.
It might help to see a directory listing of the three directories mentioned in the script:
/abc01/ihost/log/
/abc01/imail/log/
/abc01/ihostlog/
Or you could view this request as a hint about a possible problem .... ?
Last edited by methyl; 08-31-2009 at 07:15 PM..
Reason: grammar
i have two csv files (rates.csv, reference.csv) as below.
rates.csv contains Code, respective Zone details
rates.csv
----------
23,38Nhava
45,37NEWYORK
89,SHILANG
71,ROBACCA
reference.csv contains all Zone details
reference.csv
-------------
37Newyork
robacca
38Nhava... (5 Replies)
Please help me to write the following script.
1) Input files will be in Test directory. (Test/YYYY/MM) folders (Ex: 1) 2010/ 01 2) 2011/05)
The file name will be Testfile1_6676543218_Axxxxxxyyyyyzzzzzzzzzzzzzzzzzz.pdf.gz
2) The compare file will be in /tmp directory. (/tmp/comparefile.txt). The... (6 Replies)