Query on shell script
Hi,
I have a requirement to scan Oracle's alert log file. This file logs all event for Oracle database and each line will have timestamp followed by messages (which might be one or more lines). Example. Thu Aug 15 17:35:59 2013 VKTM detected a time drift. Please check trace file for more details. I have a requirement to scan this log to fine last 5 minutes worth of data entered on this. Could you please help me with the same. Thanks in advance for your help. Thanks, Manick. |
Sure, we'll be glad to help. So post what you've written so far. But we're not going to write your scripts for you.
|
date --date="5 min ago"
you may need to play around with the output format man date for details then you could just grep that date, with a silly 'after' ( -A 5000 ) Code:
FiveMinAgo="$(date +"%b %d %H:%M" --date="5 min ago") You may need to be 'smarter' but you have something to work with ( don't expect the above to be fool proof, it isn't ) |
All times are GMT -5. The time now is 10:16 AM. |