I am trying to write a script to do monitoring kind of stuff,
requirement - when a server is given a start it updates a file called server.log, I need to keep on grepping the word "Running" and as soon as it comes , script should be exited with the message , "Server came up successfully else it shoud wait for "Running" untill 7 minuts, and then should time out with the message "script timed out"
My idea is to use tail -f server.log | grep "Running" , but im not sure how will this exit because tail will wait for the input into server.log
for timinig out I think best I can use is sleep
so it shoud be
PLease suggest. if my logic is wrong or i have placed wrong commands.
Last edited by Scott; 01-28-2010 at 11:57 AM..
Reason: Code tags, please...
if you are not sure when the server will be started then you can write two scripts, first one will check if server is started or not. Then place this script into crontab and set its check (running) period according to your requirements and your system performance; lets say 15 seconds everyday, or 1 day of month or one day of every week etc.. Then add a conditional part into the first script so that you can trigger the second script with grep part.
HI all...
(Apologies for any typos.)
To add to Neo's Arduino subject matter I have decided to upload this in ".zip" format.
Ignore "*.info" files these are AMIGA icons only and also the "HAM" drawer as these are photos in ancient AMIGA HAM modes.
I have noticed that there are current... (6 Replies)
Hi,
My input file data will be
|ABCD|EFGH|IJKL|MNOP
|ABCD|EF\|GH|IJKL|MNOP
I am expecting output ,
|"ABCD"|"EFGH"|"IJKL"|"MNOP"
|"ABCD"|"EF|GH"|"IJKL"|"MNOP"
Note : The change basically the pipe deilmited file does contain | as value for some of the column but | will come with... (8 Replies)
Hi ,
This is a pretty simple sed command i found when i was checking out one of the codes of my colleague .
sed -e 's/\*.*\) \(\ <1*e\ >\) \(*.*\)/\2/'
When i tried this on a few text files it was displaying the entire line. If this was to display entire line why sweat out on a sed . Does... (3 Replies)
I coudln't think of another topic to post this under as the OS on the system is XP pro.
Ok here is the go.
I'm upgrdaing a mates computer. A AMD 1200Mhz and well it wouldn't boot from the CD to do a fresh install (By upgrade I mean OS with complete new install). So I opened up the box and... (4 Replies)
I hacked my TIVO a few months ago. I made a computer specifically for this, but I only used a UNIX boot disk to get all the TIVO goodies to work. I am intersted in getting some version of UNIX on this machine and getting it onto my network. I only want to do some simple file transfers, maybe... (1 Reply)