Re: Dry-run mode for pg_archivecleanup

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Gabriele Bartolini <gabriele(dot)bartolini(at)2ndquadrant(dot)it>
Cc: PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dry-run mode for pg_archivecleanup
Date: 2012-01-15 22:05:17
Message-ID: CAK3UJRFdfbK43A02JqvVk5CtRQypMuh8tGhfKXj2acNS27uiUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 15, 2012 at 3:02 PM, Gabriele Bartolini
<gabriele(dot)bartolini(at)2ndquadrant(dot)it> wrote:

> My actual intention was to have the filename as output of the command, in
> order to easily "pipe" it to another script. Hence my first choice was to
> use the stdout channel, considering also that pg_archivecleanup in dry-run
> mode is harmless and does not touch the content of the directory.

Oh, right - I should have re-read your initial email before diving
into the patch. That all makes sense given your intended purpose. I
guess your goal of constructing some simple way to pass the files
which would be removed on to another script is a little different than
what I initially thought the patch would be useful for, namely as a
testing/debugging aid for an admin.

Perhaps both goals could be met by making use of '--debug' together
with '--dry-run'. If they are both on, then an additional message like
"pg_archivecleanup: would remove file ... " would be printed to
stderr, along with just the filename printed to stdout you already
have.

Josh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ants Aasma 2012-01-15 22:14:45 Re: Patch: add timing of buffer I/O requests
Previous Message Jeff Janes 2012-01-15 22:01:31 Re: Standalone synchronous master