The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search and Parse string from inside a File SSims UNIX for Dummies Questions & Answers 2 11-08-2007 12:50 PM
how to search string and number in one file and check in the other file knshree Shell Programming and Scripting 9 08-24-2007 01:29 AM
How to search a string in a file. prathap UNIX for Dummies Questions & Answers 1 07-16-2007 11:41 PM
appending string to text file based on search string malaymaru Shell Programming and Scripting 1 06-09-2006 05:53 AM
please help me to search string in a file ...... swamymns Shell Programming and Scripting 2 02-01-2006 09:20 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-12-2006
Registered User
 

Join Date: Dec 2005
Posts: 7
String search in log file

Hi all!

I have a log file from an incremental backup. This next script I've done works when the backup completes in the same day it started. But if the backup goes on to the next day, this one doesn't work anymore.

##################################
#VARS
data=`date '+%m/%d/%y'`
directoria='/var/local/logs/backup'
###################################
select versao in diario semanal mensal
do
case $versao in
diario) grep $data $directoria/dsmsched_diario.log > $directoria/back.log;;
semanal) grep $data $directoria/dsmsched_semanal.log > $directoria/back.log
;;
mensal) grep $data $directoria/dsmsched_mensal.log > $directoria/back.log;;
*) print "As opcoes sao 1,2 e 3"; break;;
esac
done
more $directoria/back.log
rm $directoria/back.log



Log file looks like this

07/05/06 23:58:17 Normal File--> 1,048,580,096 /ONLINE/u03/oradata/HIST_EI
/eigraciosatab01.dbf [Sent]
07/05/06 23:59:41 Normal File--> 1,048,580,096 /ONLINE/u03/oradata/CTTSITE
/moverstab01.dbf [Sent]
07/06/06 00:00:09 Normal File--> 734,007,296 /ONLINE/u03/oradata/EI_PDL/
eitab01.dbf [Sent]
07/06/06 00:00:34 Normal File--> 209,719,296 /ONLINE/u03/oradata/CTTSITE
/questtab.dbf [Sent]
delete
Reply With Quote
Forum Sponsor
  #2  
Old 07-12-2006
Registered User
 

Join Date: Dec 2005
Posts: 7
I've solved... I used egrep command. egrep let use two strings in same command. Tkz anyway
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0