![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| search by modified date | kotasateesh | Shell Programming and Scripting | 4 | 06-24-2008 06:59 AM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 06:24 AM |
| Search files between a date range | zcanji | Shell Programming and Scripting | 4 | 09-05-2007 12:38 AM |
| find file with date and recursive search for a text | rosh0623 | UNIX for Advanced & Expert Users | 10 | 08-16-2006 11:27 AM |
| Search by modification date | slink | UNIX for Dummies Questions & Answers | 5 | 05-25-2006 03:07 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
date search
Hi
Need to serach a file after a particular date for a pattren match example: 1) ldr.out => last run date is stored in which has value 2007-09-20 2) dberror.log => captures all db errors with date Requirement ========== shell script to get the ldr.out date value and search the file dberror.log for particular pattern "dbcrash" after 2007-09-20 till date if it exists echo "dbcrash has happened after | 2007-09-20 " else exit Thanks Thiru |
| Forum Sponsor | ||
|
|
|
|||
|
This file has the last run date
[Servername:/home/out]cat sample_lrd.out 2007-09-20 dberror.log [:/home/db2inst1/sqllib/db2dump]cat db2diag.log Unreserved memory left in set : 573440 bytes. 2007-09-20-14.39.47.703273-420 E29493A716 LEVEL: Warning PID : 630882 TID : 1 PROC : db2agent (SAMPLE) 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE APPHDL : 0-52 APPID: *LOCAL.db2inst1.070923213947 FUNCTION: DB2 UDB, SQO Memory Management, sqloMemLogPoolConditions, probe:10 DATA #1 : <preformatted> DBM_DB memory set automatically extended for Backup/Restore/Util Heap (UTIL_HEAP_SZ) on node 0. Requested block size : 33558543 bytes. Physical heap size : 201605120 bytes. Heap reserved size : 20496384 bytes. Unreserved memory used by heap : 181108736 bytes. Unreserved memory left in set : 573440 bytes. 2007-09-23-14.39.47.706826-420 E30210A716 LEVEL: Warning PID : 630882 TID : 1 PROC : db2agent (SAMPLE) 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE APPHDL : 0-52 APPID: *LOCAL.db2inst1.070923213947 FUNCTION: DB2 UDB, SQO Memory Management, sqloMemLogPoolConditions, probe:10 DATA #1 : <preformatted> DBM_DB memory set automatically extended for Backup/Restore/Util Heap (UTIL_HEAP_SZ) on node 0. Requested block size : 33558543 bytes. Physical heap size : 235175936 bytes. Heap reserved size : 20496384 bytes. Unreserved memory used by heap : 214679552 bytes. Unreserved memory left in set : 573440 bytes. 2007-09-23-14.39.47.710385-420 E30927A716 LEVEL: Warning PID : 630882 TID : 1 PROC : db2agent (SAMPLE) 0 INSTANCE: db2inst1 NODE : 000 DB : SAMPLE APPHDL : 0-52 APPID: *LOCAL.db2inst1.070923213947 FUNCTION: DB2 UDB, SQO Memory Management, sqloMemLogPoolConditions, probe:10 DATA #1 : <preformatted> DBM_DB memory set automatically extended for Backup/Restore/Util Heap (UTIL_HEAP_SZ) on node 0. Requested block size : 33558543 bytes. Physical heap size : 268746752 bytes. Heap reserved size : 20496384 bytes. Unreserved memory used by heap : 248250368 bytes. Unreserved memory left in set : 573440 bytes. |
|
|||
|
Madhan,
Thanks for ur help awk -v var=`cat date_file` '{ if ( $0 ~ var ) { print } }' log_file this will get the date and search for the pattern in log file . can u help me in this 1) search for pattern 1 in log file ( ur awk cmd will work) if it exists then 2) then search for pattren2 from the last occurance of pattern1 3) if pattern2 exists echo "pattern2 has happened after | date_file value " fi Regards Thiru |
|||
| Google The UNIX and Linux Forums |