The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-22-2008
newbie22102 newbie22102 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 7
New to scripting, Need help

We have database name Progress.

We will restore prod back files to UserServer on Sunday. Except all other days We will keep apply AI(trsaction log files kind in db2) files of that day. I have appy the log files in SEQUENTIAL order by timestamp which is part of file name. It's not really applying log siles in sequential order.

#set -x
DATE=`date "+%y%m%d%H%M%S"`

########## MAIN FUNCTION
myfunc ()
{
ls -ltr /archive/testdb/|grep progress|cut -c67-78>unc
while read ai
do
echo $ai is getting Verifified by If clause
#if [ "${ai}" -le "${DATE}" ]; then
if [ "${ai}" -le 080214121500 ]; then
echo $ai "<" 080214121500
#echo $ai "<" $DATE
$DLC/bin/rfutil dbname -C roll forward -a /archive/testdb/ai.$ai
else
echo ""
echo "Can't apply Log File $ai is >= 080214121500"
fi
done < unc
rm unc
}
################ MAIN

How can apply the log is sequntial order based on the filenames???

Any help wold be appriciated

Last edited by newbie22102; 02-25-2008 at 11:08 AM..