Re: Deleting old WAL-files

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Gustav Karlsson <Gustav(dot)Karlsson(at)bekk(dot)no>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Deleting old WAL-files
Date: 2015-05-19 11:51:21
Message-ID: CABUevExDG6-zTv84fP7ttSUu6QHYsFJRCJcPYAMhUVthQnmpFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, May 19, 2015 at 1:43 PM, Gustav Karlsson <Gustav(dot)Karlsson(at)bekk(dot)no>
wrote:

> Hi,
>
> I am looking for a good method of determining what WAL-segments can be
> deleted from our backup-archive.
>
> We are using Postgresql 9.3 and do nightly basebackups along with
> archiving of WAL-segments.
>
> We would like to prevent our backup-archive from growing forever, and thus
> delete basebackups and WAL-segments older than say 1 year.
>
> Is there a good way of finding the oldest WAL-segment needed for a given
> basebackup? (If not, what is the typical method for deleting old
> WAL-segments?)
>

You can look inside the backup_label file in the base backup. It has the
starting WAL file required to recover from that backup. If you look at the
.backup file that's been archived to the log archive it also contains the
last segment required.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jan Lentfer 2015-05-19 11:52:39 Re: Deleting old WAL-files
Previous Message Gustav Karlsson 2015-05-19 11:43:04 Deleting old WAL-files