Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/pgarchivecleanup.sgml`
610875d7537eebdf4988995394bdaf463eb84ad1cffd44ea000000010000095f
 <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

Title: pg_archivecleanup: Options and Usage
Summary
This section details the command-line options for pg_archivecleanup, including options to remove backup history files (-b/--clean-backup-history), enable debug logging (-d/--debug), perform a dry run (-n/--dry-run), display the version (-V/--version), and strip file extensions (-x/--strip-extension). It emphasizes that pg_archivecleanup requires read and write access to the archive directory and provides an example of removing WAL files prior to a specific base backup.