Re: [GENERAL] Associating a basebackup and it's .backup WAL file

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [GENERAL] Associating a basebackup and it's .backup WAL file
Дата
Msg-id CAB7nPqQt+bZ5_43Hg0ThdewFJWp8P7T5HhkhGTysvc6NpDix_w@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Associating a basebackup and it's .backup WAL file  (cen <imbacen@gmail.com>)
Ответы Re: [GENERAL] Associating a basebackup and it's .backup WAL file  (cen <imbacen@gmail.com>)
Список pgsql-general
On Thu, Jul 13, 2017 at 10:30 AM, cen <imbacen@gmail.com> wrote:
> Given a basebackup base.tar.gz and an archive of WAL files, is there any way
> to find out which .backup WAL file is associated with the basebackup from
> command line?

Not from what Postgres ships directly. Without any custom meta data
save with each one of your backups, say something that you write after
calling pg_basebackup, you would need to untar base.tar to look for
the backup_label file.

> My use case is for a retention policy bash script which:
> -deletes all basebackups older than X days
> -runs pg_archivecleanup for the oldest basebackup
>
> I just don't know how to find out which WAL to feed to pg_archivecleanup at
> this point.

Recalling something I know about, pg_rman uses its own meta data to do
this decision making with dedicated folder names that use a structure
and names based on timestamps, and this meta data is written and saved
when each backup is taken. This saves future lookups at all tarballs
when doing cleanup of past backups.

I am not sure about the more popular barman and pgBackrest since I
know them less, but I would imagine they handle retention policies
similarly.
--
Michael


В списке pgsql-general по дате отправления:

Предыдущее
От: cen
Дата:
Сообщение: [GENERAL] Associating a basebackup and it's .backup WAL file
Следующее
От: Gregory Nicol
Дата:
Сообщение: [GENERAL] LDAP authentication without OU in ldapbasedn