pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Boris Bukowski <bukowski@louis.info>
To: Giuseppe Broccolo <giuseppe.broccolo@2ndquadrant.it>
To: pgsql-admin@postgresql.org
Subject: Re: Base Backups to a remote location
Date: Fri, 6 Dec 2013 15:43:03 +0100
Message-ID: <MP368A8BDD00E21C52A1E277.50208@louis.info> (raw)
In-Reply-To: <52A1B9CD.2060505@2ndquadrant.it>
References: <MP75BCF26F00D12852A1A181.6040300@louis.info>
	<52A1B9CD.2060505@2ndquadrant.it>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On 06.12.2013 12:49, Giuseppe Broccolo wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Il 06/12/2013 11:05, Boris Bukowski ha scritto:
>> Hi,
>>
>> i use the following script to backup servers every day to a remote
>> location.
>>
>> ---snip--- REMOTE=xyz123.louis.info DATE=`date +%Y%m%d%H%M%S`
>>
>> ssh xyz123.louis.info "echo \"checkpoint; SELECT
>> pg_start_backup('${DATE}');\" |psql"
>>
>> rsync -avxz  --numeric-ids
>> --exclude-from=/backup1/config/excludes.txt --delete-excluded
>> --inplace --delete root@${REMOTE}:/
>> /mnt/backup1/remote/xyz123/full
>>
>> ssh xyz123.louis.info "echo \"SELECT pg_stop_backup();\" |psql"
>>
>> ---snip---
>>
>> i have some questions about this: 1. will this always work?
>
> In principle, this could be enough. The important thing is to be sure
> that WAL archiving is enabled and working before performing the
> backup, configuring the 'archive_command' parameter. In this way,
> archiving of these files happens automatically since you have already
> configured archive_command and pg_stop_backup() does not return until
> the last segment has been archived.
> I just want to remark that pg_start_backup() already performs a
> checkpoint: this is the reason it sometimes takes a significant period
> of time. So you can omit it.
>
> Just to make the script more readable, you can change the command
>
> echo "SELECT pg_start_backup('${DATE}');" |psql
>
> in
>
> psql -c "SELECT pg_start_backup('${DATE}');"
>
>> 2. between these backups i do not save the archive logs, is this
>> secure?
>
> What are you meaning? As I said before, you have to be sure that
> 'archive_command' is opportunely set, considering also a compression.
These are complete VM's with Webserver and Postgres. Once per day I 
take a complete snapshot of everything and feed it in our backup system.

Is this enough to get my Database always up again or do i miss 
something? Continuous Archiving is not my intention.

best Regards
Boris Bukowski



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (6+ messages)  latest in thread

Message-ID: <MP368A8BDD00E21C52A1E277.50208@louis.info>
Permalink:  ../MP368A8BDD00E21C52A1E277.50208@louis.info/
Also on:    postgresql.org/message-id/MP368A8BDD00E21C52A1E277.50208@louis.info

 · 

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: bukowski@louis.info, giuseppe.broccolo@2ndquadrant.it
  Subject: Re: Base Backups to a remote location
  In-Reply-To: <MP368A8BDD00E21C52A1E277.50208@louis.info>
  References: <MP75BCF26F00D12852A1A181.6040300@louis.info> <52A1B9CD.2060505@2ndquadrant.it> <MP368A8BDD00E21C52A1E277.50208@louis.info>

* 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