Re: a few questions on backup - Mailing list pgsql-general

From Tom Lane
Subject Re: a few questions on backup
Date
Msg-id 11871.1179155474@sss.pgh.pa.us
Whole thread Raw
In response to a few questions on backup  (Marco Colombo <pgsql@esiway.net>)
Responses Re: a few questions on backup
List pgsql-general
Marco Colombo <pgsql@esiway.net> writes:
> Am I right in assuming that the following procedure is ok?

> 1) issue pg_start_backup();
> 2) copy (or tar or cpio) the data dir, w/o pg_xlog/
> 3) issue pg_stop_backup();
> 4) copy (or tar or cpio) pg_xlog/ contents.

No.  You have to have an actual archive_command script copying the WAL
segments somewhere else when told to.  An asynchronous copy of the xlog
directory will be nothing but garbage, because we recycle WAL segments
as fast as we can (ie, as soon as the archive_command claims to have
saved the data).

1) 2) and 3) are OK, but you need to use archive_command to collect the
xlog segments.

Actually ... given your low requirements, I wonder why you don't just
stop the postmaster, tar the datadir, start the postmaster.

            regards, tom lane

pgsql-general by date:

Previous
From: Marco Colombo
Date:
Subject: a few questions on backup
Next
From: Hannes Dorbath
Date:
Subject: Re: a few questions on backup