pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: Jeff Frost <jeff@frostconsultingllc.com>
Subject: Re: archive_command
Date: Tue, 04 Oct 2005 17:51:58 +0200
Message-ID: <4342A51E.5030502@bigfoot.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0510031950290.10454@discord.dyndns.org>
References: <20031115132118.V74587@holywar.net>
	<433AC059.1050300@musicrebellion.com>
	<Pine.LNX.4.63.0509280925070.28080@discord.dyndns.org>
	<433ACE02.3040208@musicrebellion.com>
	<1128071627.19345.256.camel@localhost.localdomain>
	<Pine.LNX.4.63.0509300926340.1280@discord.dyndns.org>
	<1128113968.4045.32.camel@localhost.localdomain>
	<Pine.LNX.4.63.0510012142210.13614@discord.dyndns.org>
	<1128246295.3717.76.camel@localhost.localdomain>
	<Pine.LNX.4.63.0510031950290.10454@discord.dyndns.org>

Jeff Frost wrote:
> On Sun, 2 Oct 2005, Simon Riggs wrote:
> 
>> Probably the best idea is to backup the last WAL file for each timeline
>> seen. Keep track of that, so when the current file changes you'll know
>> which timeline you're on and stick to that from then on. Or more simply,
>> put some notes with your program saying "if you ever use a complex
>> recovery situation, make sure to clear all archive_status files for
>> higher timeline ids before using this program".
> 
> Tell me if you think this is the most reasonable way to determine the in
> use WAL file:
> 
> ls -rt $PGDATA/pg_xlog/ | grep -v "backup\|archive\|RECOVERY" | tail -1
> 

Look at this post I did last year:
http://archives.postgresql.org/pgsql-admin/2005-06/msg00013.php

in that messages there are two script that deliver remotelly the
archive wall, and they store too last WAL in order to not loose the
current WAL in case of crash.

This was the function I used to find the WAL in use:

function copy_last_wal
 {
    FILE=$( ls -t1p $PGXLOG | grep -v / | head -1 )

    echo "Last Wal> " $FILE

    cp ${PGXLOG}/${FILE} ${PARTIAL}/${FILE}.tmp
    mv ${PARTIAL}/${FILE}.tmp ${PARTIAL}/${FILE}.partial
    find ${PARTIAL} -name *.partial | grep -v ${FILE} | xargs -i rm -fr {}
 }


At that time Tom Lane agreed to provide some functions to ask the engine
the name of WAL currently in use, dunno if in the new 8.1 something was
done in order to help this process.


Regards
Gaetano Mendola




view thread (17+ messages)  latest in thread

Message-ID: <4342A51E.5030502@bigfoot.com>
Permalink:  ../4342A51E.5030502@bigfoot.com/
Also on:    postgresql.org/message-id/4342A51E.5030502@bigfoot.com

 · 

reply

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: mendola@bigfoot.com, jeff@frostconsultingllc.com
  Subject: Re: archive_command
  In-Reply-To: <4342A51E.5030502@bigfoot.com>
  References: <20031115132118.V74587@holywar.net> <433AC059.1050300@musicrebellion.com> <Pine.LNX.4.63.0509280925070.28080@discord.dyndns.org> <433ACE02.3040208@musicrebellion.com> <1128071627.19345.256.camel@localhost.localdomain> <Pine.LNX.4.63.0509300926340.1280@discord.dyndns.org> <1128113968.4045.32.camel@localhost.localdomain> <Pine.LNX.4.63.0510012142210.13614@discord.dyndns.org> <1128246295.3717.76.camel@localhost.localdomain> <Pine.LNX.4.63.0510031950290.10454@discord.dyndns.org> <4342A51E.5030502@bigfoot.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