warm database.

From: "Praveen Kumar \(TUV\)" <praveen(dot)k(at)renaissance-it(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: warm database.
Date: 2008-02-13 05:21:21
Message-ID: 84D57263D486374587DA0820E60A2CC601ACA239@srit_mail.renaissance-it.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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=$1

RESTORE_TO=$2

DELAY=100000

TRIGGERED=0

TRIGGER_FILE="/home/backup/trigger"

copyfunc() {

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

cp -v -i $RESTORE_FROM $RESTORE_TO

fi

}

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

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

copyfunc;

exit $?;

fi

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

usleep $DELAY;

if [ -e $TRIGGER_FILE ]; then

TRIGGERED=1;

fi

done

copyfunc;

when I debug this script through command sh -x restore.sh

it show like that.

+ RESTORE_FROM=

+ RESTORE_TO=

+ DELAY=100000

+ TRIGGERED=0

+ TRIGGER_FILE=/home/backup/trigger

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

expr: syntax error

+ k=

+ '[' '' == backup ']'

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

+ usleep 100000

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

+ TRIGGERED=1

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

+ copyfunc

+ '[' 1 -eq 0 ']'

Praveen kumar DBA -Delivery

E-mail: praveen(dot)k(at)renaissance-it(dot)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

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

URL: www.renaissance-it.com
<file:///C:\Documents%20and%20Settings\praveen.k\Application%20Data\Micr
osoft\Local%20Settings\Temporary%20Internet%20Files\Content.Outlook\UXU0
OG4I\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.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David Wall 2008-02-13 05:36:36 Re: warm database.
Previous Message Tena Sakai 2008-02-12 19:45:44 Re: 8.3.0 upgrade, confused by documentation