I want to check a log file that gets updated very frequently, almost every second. What I want to do from a script is to check this log file
1) for a particular string
2) for a specified time
while it is getting updated. And as soon as it finds that particular string the command should stop.
I got the information from this forum which will satisfy the need 1)
but now I am looking how can a specify time for which the log file should be checked.
Originally Posted by Annihilannic
Try:
Code:
No need for a kill, the tail should terminate automatically when the pipe is closed.
Above is the code I used to check the log file for a particular string and exit when it is found. But now I want to specify time for which the log file should be checked and if the string is not found in the specified time then tail stop. Is it possible?
Hi
I have a file which is updated very frequently.
Where in i wanted to use tail -f command in the script and wanted to grep for a particular word.
But the issue is when i use tail -f filename|grep "word" ...
it will show me blank until the word is found in the real time. if it shows... (13 Replies)
I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250.
I would like to join all 250 of them together tail by tail as follows. For example
stat.1000
a b c
d e f
stat.1001
g h i
j k l
So that my output... (2 Replies)
Hi Guys,
I am developing a script to monitor log file Generated every hour.
When creating a new file scripts not working.
My Code . I want to monitor GatewayTransaction.yyyymmdd-hh.log
while true; do newdate=$(date '+%Y%m%d') ; nowdate=$(date '+%Y%m%d-%H.log'); tail -f... (7 Replies)
hi
i need to run from a bash script
tail -f /var/log/access_log >> access1
tail -f /var/log/prod/prod1 >> access1
tail -f /var/log/prod/prod2 >> access1
this script purpose is to start at server boot time
and should always run.
what is the best way to put it on a script
Thanks
Dan (1 Reply)
How to tail -f real time file.
I want to tail file created last time.
The server is gen new file Always.
.
An example file.
-rw-r--r-- 1 shinnie tiituck 251M Oct 18 05:39 20111018_00.log
-rw-r--r-- 1 shinnie tiituck 251M Oct 18 11:18 20111018_01.log
-rw-r--r-- 1 shinnie tiituck... (3 Replies)
We have recently downloaded, installed and compiled gcc-3.0.4 code. gcc compiler has built successfully and we where able to compile some same test cpp file. I would like to know how we can modify gcc source code so that we add additional run time debugging statements like the binary in execution... (4 Replies)
Hi,
I have a log file without date/time, and I want that everytime tail|grep find something it displays the date/time and the line. I have tried something like this command but without any luck to display the date/time:
tail -F catalina.out | sed "s/^/`date `/" | egrep ... (6 Replies)
Hello guys, I am new at shell scripting and I want to create a script that runs several commands at a time, ie: uptime, w, df -h and so on and send the output of this commands to a text file so it can be send via email at a certain time using crontab.
Any help will be much appreciated! (4 Replies)
Hi
My five script run throgh crontab at same time at 6 clock.
Due to problem in the data load .Now I want to check time of load finish run these jobs. I create a script which check the load finish time but I have no idea how I run these JObs. This is very urget to me. Please reply me as soon... (3 Replies)