Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3379B2E02A0 for ; Wed, 13 Feb 2008 01:23:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 27474-03 for ; Wed, 13 Feb 2008 01:23:30 -0400 (AST) Received: from mail.renaissance-it.com (unknown [164.164.87.55]) by postgresql.org (Postfix) with ESMTP id 5BC5E2E00B6 for ; Wed, 13 Feb 2008 01:19:51 -0400 (AST) X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C86E00.452A8DF2" Subject: warm database. Date: Wed, 13 Feb 2008 10:51:21 +0530 Message-ID: <84D57263D486374587DA0820E60A2CC601ACA239@srit_mail.renaissance-it.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: warm database. Thread-Index: AchuAETfc5WYQJxxS/m1wMf2xz4yAg== From: "Praveen Kumar \(TUV\)" To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/150 X-Sequence-Number: 28224 This is a multi-part message in MIME format. ------_=_NextPart_001_01C86E00.452A8DF2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, I am planning to make setup for warm standby databae in postgres. But I am facing problem when I try to apply WAL files using shell scripts restore.sh.=20 After applying exiting WAL file in archive directory, it does not wait for next WAL files and come out and write the message in database logfile which show that Archive recovery is completed.Now system is ready for use. =20 I check this restore.sh file and tried to debug which show syntax error in below mentioned line. Can anybody tell me why it is showing syntax error and why it is not waiting for next WAL files =20 =20 Restore.sh =20 #!/bin/bash =20 RESTORE_FROM=3D$1 RESTORE_TO=3D$2 DELAY=3D100000 TRIGGERED=3D0 TRIGGER_FILE=3D"/home/backup/trigger" =20 copyfunc() { if [ "$TRIGGERED" -eq "0" ]; then cp -v -i $RESTORE_FROM $RESTORE_TO fi } =20 k=3D`expr $1 : '.*\(history\)'` ------------this is the line which = show syntax error =20 if [ "$k" =3D=3D "history" ]; then copyfunc; exit $?; fi =20 =20 while [ ! -f "$RESTORE_FROM" -a "$TRIGGERED" -eq "0" ]; do usleep $DELAY; if [ -e $TRIGGER_FILE ]; then TRIGGERED=3D1;=20 fi done =20 copyfunc; =20 =20 when I debug this script through command sh -x restore.sh it show like that. =20 + RESTORE_FROM=3D + RESTORE_TO=3D + DELAY=3D100000 + TRIGGERED=3D0 + TRIGGER_FILE=3D/home/backup/trigger ++ expr : '.*\(history\)' expr: syntax error + k=3D + '[' '' =3D=3D backup ']' + '[' '!' -f '' -a 0 -eq 0 ']' + usleep 100000 + '[' -e /home/backup/trigger ']' + TRIGGERED=3D1 + '[' '!' -f '' -a 1 -eq 0 ']' + copyfunc + '[' 1 -eq 0 ']' =20 =20 =20 Praveen kumar DBA -Delivery E-mail: praveen.k@renaissance-it.com | Extn: 1607 =20 Sobha Renaissance Information Technology (P) Ltd. An SEI-CMM, P-CMM & SSE-CMM Level 5 Company | BS ISO/IEC 27001:2005 & ISO 9001:2000 Certified A Top 50 Fast Growing Technology Company (Deloitte, 2006 & 2007) | A Six Sigma Practice Company=20 =20 Phone: + 91 80 41951999 | Fax: + 91 80 41523300 URL: www.renaissance-it.com | Video Conference: + 91 80 41252222 =20 The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete all copies from any computer. =20 ------_=_NextPart_001_01C86E00.452A8DF2 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

=

I am planning to make setup for = warm standby databae in postgres. But I am facing problem when I try to apply = WAL files using shell scripts restore.sh.

After applying exiting WAL file in archive directory, it does not wait for next WAL files and come out =  and write  the message in database logfile which show = that

Archive recovery is completed.Now system is ready for = use.

 

=

I check this restore.sh file  = and tried to debug  which show syntax error in below mentioned = line.

Can anybody tell me why it is  showing syntax error  and why it is not waiting for next WAL = files

 

=

 

=

Restore.sh=

 

=

#!/bin/bash

 

=

RESTORE_FROM=3D$1=

RESTORE_TO=3D$2

DELAY=3D100000

TRIGGERED=3D0

TRIGGER_FILE=3D"/home/backup/t= rigger"

 

=

copyfunc() = {

if [ "$TRIGGERED" -eq "0" ]; then

      = ;      cp -v -i $RESTORE_FROM $RESTORE_TO

fi

}

 

=

k=3D`expr $1 : '.*\(history\)'`  ------------this is the  line which = show syntax error

 

=

if [ "$k" =3D=3D "history" ]; then

copyfunc;<= /p>

exit = $?;

fi     &nb= sp;    

 

=

while [ ! -f = "$RESTORE_FROM" -a "$TRIGGERED" -eq "0" ]; = do

      = ;            =       usleep $DELAY;

      = ;            =       if [ -e $TRIGGER_FILE ]; then

      = ;            =             &= nbsp;     TRIGGERED=3D1;

      = ;            =       fi

done

 

=

copyfunc;<= /p>

 

=

 

=

when I debug this script through = command sh –x restore.sh

it show like = that.

 

=

+ = RESTORE_FROM=3D

+ = RESTORE_TO=3D

+ = DELAY=3D100000

+ = TRIGGERED=3D0

+ = TRIGGER_FILE=3D/home/backup/trigger

++ expr : '.*\(history\)'

expr: syntax error

+ = k=3D

+ '[' '' =3D=3D backup = ']'

+ '[' '!' -f '' -a 0 -eq 0 = ']'

+ usleep = 100000

+ '[' -e /home/backup/trigger = ']'

+ = TRIGGERED=3D1

+ '[' '!' -f '' -a 1 -eq 0 = ']'

+ = copyfunc

+ '[' 1 -eq 0 = ']'

 

=

 

 

Praveen kumar DBA = -Delivery

E-mail: = praveen.k@renaissance-it.com = | Extn: = 1607

 

 Sobha Renaissance Information = Technology (P) Ltd.

An SEI-CMM, P-CMM & SSE-CMM = Level 5 Company | = BS ISO/IEC 27001:2005 & ISO 9001:2000 = Certified

A Top 50 Fast Growing Technology Company (Deloitte, = 2006 & 2007) = | A Six Sigma Practice Company

 <= /o:p>

Phone: = + 91 80 41951999 | Fax: = + 91 80 41523300

URL: = www.renaissance-it.com = | Video Conference: + 91 80 = 41252222

=

 

The information transmitted is intended only for the = person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other = use of, or taking of any action in reliance upon this information by persons = or entities other than the intended recipient is prohibited. If you = received this in error, please contact the sender and delete all copies from any = computer.

 

------_=_NextPart_001_01C86E00.452A8DF2--