Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id EC6FC2E3A17 for ; Tue, 15 Jan 2008 05:44:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 56451-08 for ; Tue, 15 Jan 2008 05:44:35 -0400 (AST) Received: from smtp.l00-bugdead-prods.de (48.53.204.212.ediscom.de [212.204.53.48]) by postgresql.org (Postfix) with ESMTP id 17C932E3A16 for ; Tue, 15 Jan 2008 05:44:37 -0400 (AST) Received: by smtp.l00-bugdead-prods.de (Postfix, from userid 1001) id D7C963AA8A; Tue, 15 Jan 2008 10:44:28 +0100 (CET) organization: L00 bugdead prods. X-Mailer: OpenGroupware.org MIME-Version: 1.0 from: "Sebastian Reitenbach" Subject: backup WAL files, to: pgsql-admin@postgresql.org reply-to: "Sebastian Reitenbach" content-type: text/plain; charset="us-ascii" date: Tue, 15 Jan 2008 10:44:28 +0100 content-transfer-encoding: 7bit Message-Id: <20080115094428.D7C963AA8A@smtp.l00-bugdead-prods.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/153 X-Sequence-Number: 27927 Hi, I use a script like the example below to generate a list of the WAL files that have to be saved by the backup job. I take the the names of the first and last WAL files from the backup HISTORYFILE generated by pg_start_backup() and pg_stop_backup(). The names of the WAL files between the first and the last I calculate the following way: HISTORYFILE=`find ${ARCHIVEPATH} -name "*.backup" -exec grep -l "backup-${DATABASE}-${NOW}" {} \;` FIRSTWALFILE=`grep "START WAL LOCATION" ${HISTORYFILE} | awk '{print $6} ' | sed -e 's/)$//g'` LASTWALFILE=`grep "STOP WAL LOCATION" ${HISTORYFILE} | awk '{print $6} ' | sed -e 's/)$//g'` echo FIRSTWALFILE=$FIRSTWALFILE echo LASTWALFILE=$LASTWALFILE FILE_PREFIX=`echo $FIRSTWALFILE | cut -c 1-15` FIRST_SUFFIX=`echo $FIRSTWALFILE | cut -c 16-` LAST_SUFFIX=`echo $LASTWALFILE | cut -c 16-` CNTA=`echo "obase=10;ibase=16; $FIRST_SUFFIX" | bc` CNTE=`echo "obase=10;ibase=16; $LAST_SUFFIX" | bc` echo $CNTA $CNTE while [ $CNTA -le $CNTE ];do echo ${FILE_PREFIX}${FIRST_SUFFIX} # >> outfile FIRST_SUFFIX=`echo "obase=16;ibase=16; ${FIRST_SUFFIX} + 1" | bc` CNTA=$(($CNTA+1)) done The WAL files have names like this: 00000001000000010000003C I am wonder what the meaning of the two 1 in the filename is? Are the WAL file names counted up to FFFFFFFFFFFFFFFFFFFFFFFFF ? Then I'll run into problems anyways as these int number are too large to be handled by bash. any insight is highly appreciated. kind regards Sebastian