Re: pg_archivecleanup not deleting anything?

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Paul Jungwirth *EXTERN*'" <pj(at)illuminatedcomputing(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_archivecleanup not deleting anything?
Date: 2015-11-02 16:10:45
Message-ID: A737B7A37273E048B164557ADEF4A58B50FC1621@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Jungwirth wrote:
> I'm running Postgres 9.3 in a warm standby configuration, and the slave
> has this setting in recovery.conf:
>
> archive_cleanup_command = '/usr/lib/postgresql/9.3/bin/pg_archivecleanup
> /secure/pgsql/archive/ %r'
>
> But I noticed that the archive directory had files going back to
> February 2014:
>
> $ ls -ltr archive | head
> total 9126292
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 000000010000000000000002.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 000000010000000000000003.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 000000010000000000000004.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 000000010000000000000006.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 000000010000000000000007.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 00000001000000000000000B.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 00000001000000000000000C.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 00000001000000000000000E.00000028.backup
> -rw------- 1 postgres postgres 300 Feb 15 2014
> 00000001000000000000000F.00000028.backup
>
> And even if I run the command by hand, nothing is actually deleted:
>
> $ pg_archivecleanup -d /secure/pgsql/archive/
> 00000001000000000000000F.00000028.backup
> pg_archivecleanup: keep WAL file
> "/secure/pgsql/archive//00000001000000000000000F" and later
>
> Despite the message, and the same files remain.
>
> Does anyone have any idea why pg_archivecleanup isn't deleting anything?

It seems like pg_archivecleanup does not delete *.backup files.

These files are rather small and are only created during a backup.
They contain information about the backup, so I guess it was decided that
they are important enough to be kept.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul Jungwirth 2015-11-02 16:17:43 Re: pg_archivecleanup not deleting anything?
Previous Message Adrian Klaver 2015-11-02 16:05:29 Re: pg_archivecleanup not deleting anything?