From: Praveen Kumar \(TUV\) <praveen.k@renaissance-it.com>
To: pgsql-admin@postgresql.org
Subject: warm database.
Date: Wed, 13 Feb 2008 10:51:21 +0530
Message-ID: <84D57263D486374587DA0820E60A2CC601ACA239@srit_mail.renaissance-it.com> (raw)
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.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
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: praveen.k@renaissance-it.com
Subject: Re: warm database.
In-Reply-To: <84D57263D486374587DA0820E60A2CC601ACA239@srit_mail.renaissance-it.com>
References: <84D57263D486374587DA0820E60A2CC601ACA239@srit_mail.renaissance-it.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox