<replaceable>oldestkeptwalfile</replaceable>. This treatment of <filename>.backup</filename>
file name allows you to remove
all WAL files archived prior to a specific base backup without error.
For example, the following example will remove all files older than
WAL file name <filename>000000010000003700000010</filename>:
<programlisting>
pg_archivecleanup -d archive 000000010000003700000010.00000020.backup
pg_archivecleanup: keep WAL file "archive/000000010000003700000010" and later
pg_archivecleanup: removing file "archive/00000001000000370000000F"
pg_archivecleanup: removing file "archive/00000001000000370000000E"
</programlisting>
</para>
<para>
<application>pg_archivecleanup</application> assumes that
<replaceable>archivelocation</replaceable> is a directory readable and writable by the
server-owning user.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<para>
<application>pg_archivecleanup</application> accepts the following command-line arguments:
<variablelist>
<varlistentry>
<term><option>-b</option></term>
<term><option>--clean-backup-history</option></term>
<listitem>
<para>
Remove backup history files as well.
See <xref linkend="backup-base-backup"/> for details about backup
history files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<term><option>--debug</option></term>
<listitem>
<para>
Print lots of debug logging output on <filename>stderr</filename>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<term><option>--dry-run</option></term>
<listitem>
<para>
Print the names of the files that would have been removed on <filename>stdout</filename> (performs a dry run).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-V</option></term>
<term><option>--version</option></term>
<listitem>
<para>
Print the <application>pg_archivecleanup</application> version and exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-x <replaceable class="parameter">extension</replaceable></option></term>
<term><option>--strip-extension=<replaceable