capture errors which occurred after certain time

capture errors which occurred after certain time

Post by J » Sat, 28 Jun 2003 04:16:32



I want to capture only those errors which occurred since the script
ran last time.

The log file with an error looks like the foll.

10:12:02 client[25733]:  dmopen: procBD failed errno=40003
11:12:02 client[25733]:  dmopen: procBD failed errno=40003
12:12:02 client[25733]:  dmopen: procBD failed errno=40003

Every time cron runs the script, I put the current time in a time.out
file

The next time cron runs the script, I want to get only those errors
that occurred after that time.

Say, the time.out contains the time 10:00:00 and the script runs the

I want to print 2 errors occurred after 10:00:00
I am using bash shell.

if condition with comparing those times $x < $y gives error.
How do you compare those two times?

Thank you
Jo

 
 
 

capture errors which occurred after certain time

Post by prab » Sat, 28 Jun 2003 18:07:01



> I want to capture only those errors which occurred since the script
> ran last time.

> The log file with an error looks like the foll.

> 10:12:02 client[25733]:  dmopen: procBD failed errno=40003
> 11:12:02 client[25733]:  dmopen: procBD failed errno=40003
> 12:12:02 client[25733]:  dmopen: procBD failed errno=40003

> Every time cron runs the script, I put the current time in a time.out
> file

> The next time cron runs the script, I want to get only those errors
> that occurred after that time.

> Say, the time.out contains the time 10:00:00 and the script runs the

> I want to print 2 errors occurred after 10:00:00
> I am using bash shell.

> if condition with comparing those times $x < $y gives error.
> How do you compare those two times?

> Thank you
> Jo

*****
Read the time from the first column of the log file and do a time
comparision as follows,

t1=`echo "10:00:00|sed  "s/://g"`

open the file
foreach each line
  #cut the first column in FIRST_COULMN var
  t2=`echo $FIRST_COLUMN|sed  "s/://g"`
  [$t2 -gt $t1 ] && echo the current line
end the loop

Regs,
Prabu

 
 
 

1. Response to posting--regarding time for certain things to occur


A good secretary types at 60 words per minute.  A word is defined as
five letters.  That means a secretary can type 300 key storkes per
minute.  Dividing by 60 to get the number of keystrokes per second,
we get five.  Thus, it will take that secretary 4 seconds to do those
twenty keystrokes.  The fastest typists do double the speed of 60
words per minute.  This means
they could do the twenty keystrokes in two seconds.

Thus, 20 keystrokes could not be done in a third of a second, by a
factor of six to twelve.  I won't comment on whether the equivalent mouse
operations under Windows would take more or less than these two to four
seconds.

2. Tape Format Tool under Linux

3. How do I Force SSH to time out if it doesnt respont for a certain time

4. miro radio build fix

5. cgi error msg.: [an error occurred while processing this directive]

6. Top 10 subjects comp.unix.admin

7. How do I increase the time before an SMTP timeout occurs..

8. ELF executable header

9. finding words that occur n times in a list

10. Matching Line After Pattern (Pattern Occurs Multiple Times)

11. Redhat 5.0 install problem, Error occurred while installing bootloader

12. Informix problems afters Y2K Solaris 2.5 patch

13. Error occurs when running zlogin <zonename> <cmd>