Re: Associating a pg_basebackup .backup file with it's saveset?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Associating a pg_basebackup .backup file with it's saveset?
Date: 2025-08-25 07:27:57
Message-ID: 27ff6d69809fe9090b4f8a3bfa0f30e9670b0d1a.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sat, 2025-08-23 at 09:56 -0400, Ron Johnson wrote:
> I'm archiving WAL files and taking basebackups.
>
> At some point, when I'm ready to delete the oldest basebackup directory,
> I'll also of course need to run "pg_archivecleanup /Database/backups/wals mumble".
>
> The .backup file is not in the pg_wal.tar file, so how do I know which .backup file to use?

One thing you can use is the "backup_label" file in the base backup.
Its first line will look like

START WAL LOCATION: 0/B000028 (file 00000001000000000000000B)

You would have to extract the WAL file name from the text.

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Sunil Jadhav 2025-08-25 18:02:06 PGD 5.8.0 setup replication lag issue
Previous Message Ron Johnson 2025-08-23 13:56:34 Associating a pg_basebackup .backup file with it's saveset?