pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_basebackup && long time storage of wal_archive/ content
Date: Wed, 15 Apr 2020 08:16:28 +0200
Message-ID: <20200415061628.GA25565@sh4-5.1blu.de> (raw)
In-Reply-To: <2fc2a90b-ab18-fd0c-c6ee-f5895471a8b1@aklaver.com>
References: <20200414150022.GA4613@sh4-5.1blu.de>
	<2fc2a90b-ab18-fd0c-c6ee-f5895471a8b1@aklaver.com>

El día Dienstag, April 14, 2020 a las 08:28:35 -0700, Adrian Klaver escribió:

> On 4/14/20 8:00 AM, Matthias Apitz wrote:
> > 
> > Hello,
> > 
> > The run (as user 'postgres') on the server of the cmd:
> > 
> > pg_basebackup -U ${DBSUSER} -Ft -z -D /data/postgresql11/backup-wal_archive-20200414-1/
> > 
> > produces correctly the following situtation on the server:
> > 
> > srap32dxr1:/data/postgresql11 # ls -ltrh backup-20200414-1
> > total 1.7G
> > -rw------- 1 postgres postgres 1.7G Apr 14 16:20 base.tar.gz
> > -rw------- 1 postgres postgres  17K Apr 14 16:20 pg_wal.tar.gz
> > srap32dxr1:/data/postgresql11 # ls -ltrh data/pg_wal
> > total 81M
> > -rw------- 1 postgres postgres 16M Apr 14 15:11 000000010000000C0000009F
> > -rw------- 1 postgres postgres 16M Apr 14 15:20 000000010000000C000000A0
> > -rw------- 1 postgres postgres 16M Apr 14 16:10 000000010000000C000000A1
> > -rw------- 1 postgres postgres 16M Apr 14 16:20 000000010000000C000000A2
> > -rw------- 1 postgres postgres 342 Apr 14 16:20 000000010000000C0000009D.00000028.backup
> > drwx------ 2 postgres postgres 36K Apr 14 16:25 archive_status
> > -rw------- 1 postgres postgres 16M Apr 14 16:50 000000010000000C0000009E
> > srap32dxr1:/data/postgresql11 # ls -ltrh wal_archive/
> > total 49M
> > -rw------- 1 postgres postgres 16M Apr 14 15:20 000000010000000C0000009B
> > -rw------- 1 postgres postgres 16M Apr 14 16:10 000000010000000C0000009C
> > -rw------- 1 postgres postgres 16M Apr 14 16:20 000000010000000C0000009D
> > -rw------- 1 postgres postgres 342 Apr 14 16:20 000000010000000C0000009D.00000028.backup
> > 
> > The content of the dir wal_archive/ is growing and growing over the
> > time.
> > 
> > The pg_wal.tar.gz contains:
> > 
> > srap32dxr1:/data/postgresql11 # tar tzf backup-20200414-1/pg_wal.tar.gz
> > 000000010000000C0000009D
> > 
> > i..e. the files 000000010000000C0000009B ... 000000010000000C0000009D
> > could be removed in wal_archive/
> > 
> > Correct? Or how is the long time storage of this dir?
> 
> pg_basebackup is a point in time backup tool.

Adrian,

Thanks for the answer. What do you mean by 'point in time backup tool'?
And, coming back to my question, can older WAL in wal_archive/ be
removed without any risks if the daily

pg_wal.tar.gz
base.tar.gz

are moved to a safe place?

> If you want something that
> continuously archives and prunes as it goes then you probably want to look
> at the tools below:
> 
> https://pgbackrest.org/
> 
> https://www.pgbarman.org/
> 
> https://postgrespro.github.io/pg_probackup/


Thanks, I will have a look into the tools.

	matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub





view thread (5+ messages)  latest in thread

Message-ID: <20200415061628.GA25565@sh4-5.1blu.de>
Permalink:  ../20200415061628.GA25565@sh4-5.1blu.de/
Also on:    postgresql.org/message-id/20200415061628.GA25565@sh4-5.1blu.de

 · 

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-general@postgresql.org
  Cc: guru@unixarea.de
  Subject: Re: pg_basebackup && long time storage of wal_archive/ content
  In-Reply-To: <20200415061628.GA25565@sh4-5.1blu.de>
  References: <20200414150022.GA4613@sh4-5.1blu.de> <2fc2a90b-ab18-fd0c-c6ee-f5895471a8b1@aklaver.com> <20200415061628.GA25565@sh4-5.1blu.de>

* 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