Home Explore Blog CI



postgresql

3rd chunk of `doc/src/sgml/ref/pg_combinebackup.sgml`
a4b274a51eb27ef6f482af9abd82e60b0baab3b4fa6aa85b0000000100000e64
 class="parameter">newdir</replaceable></option></term>
      <listitem>
       <para>
        Relocates the tablespace in directory <replaceable>olddir</replaceable>
        to <replaceable>newdir</replaceable> during the backup.
        <replaceable>olddir</replaceable> is the absolute path of the tablespace
        as it exists in the final backup specified on the command line,
        and <replaceable>newdir</replaceable> is the absolute path to use for the
        tablespace in the reconstructed backup.  If either path needs to contain
        an equal sign (<literal>=</literal>), precede that with a backslash.
        This option can be specified multiple times for multiple tablespaces.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--clone</option></term>
      <listitem>
       <para>
        Use efficient file cloning (also known as <quote>reflinks</quote> on
        some systems) instead of copying files to the new data directory,
        which can result in near-instantaneous copying of the data files.
       </para>

       <para>
        If a backup manifest is not available or does not contain checksum of
        the right type, file cloning will be used to copy the file, but the
        file will be also read block-by-block for the checksum calculation.
       </para>

       <para>
        File cloning is only supported on some operating systems and file
        systems.  If it is selected but not supported, the
        <application>pg_combinebackup</application> run will error.  At present,
        it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on
        file systems created with reflink support), and on macOS with APFS.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--copy</option></term>
      <listitem>
       <para>
        Perform regular file copy.  This is the default.  (See also
        <option>--copy-file-range</option>, <option>--clone</option>, and
        <option>-k</option>/<option>--link</option>.)
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--copy-file-range</option></term>
      <listitem>
       <para>
        Use the <function>copy_file_range</function> system call for efficient
        copying.  On some file systems this gives results similar to
        <option>--clone</option>, sharing physical disk blocks, while on others
        it may still copy blocks, but do so via an optimized path.  At present,
        it is supported on Linux and FreeBSD.
       </para>

       <para>
        If a backup manifest is not available or does not contain checksum of
        the right type, <function>copy_file_range</function> will be used to
        copy the file, but the file will be also read block-by-block for the
        checksum calculation.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--manifest-checksums=<replaceable class="parameter">algorithm</replaceable></option></term>
      <listitem>
       <para>
        Like <xref linkend="app-pgbasebackup"/>,
        <application>pg_combinebackup</application> writes a backup manifest
        in the output directory. This option specifies the checksum algorithm
        that should be applied to each file included in the backup manifest.
        Currently, the available algorithms are <literal>NONE</literal>,
        <literal>CRC32C</literal>, <literal>SHA224</literal>,
        <literal>SHA256</literal>, <literal>SHA384</literal>,
        and <literal>SHA512</literal>.  The default is <literal>CRC32C</literal>.
       </para>
     

Title: pg_combinebackup Options: Cloning, Copying, and Checksums
Summary
The options --clone, --copy, and --copy-file-range control how files are transferred during the synthetic backup creation. --clone uses file cloning (reflinks) for near-instantaneous copying, while --copy performs a regular file copy. --copy-file-range uses the copy_file_range system call for efficient copying. The option --manifest-checksums specifies the checksum algorithm to be used when writing the backup manifest in the output directory, with options like NONE, CRC32C, SHA224, SHA256, SHA384, and SHA512.