<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc title="{[project]} Command &amp; Configuration Reference">
    <config title="Configuration Reference">
        <description>The {[project]} Configuration Reference details all configuration options.</description>

        <text>
            <p><backrest/> can be used entirely with command-line parameters but a configuration file is more practical for installations that are complex or set a lot of options. The default location for the configuration file is <file>/etc/pgbackrest/pgbackrest.conf</file>. If no file exists in that location then the old default of <file>/etc/pgbackrest.conf</file> will be checked.</p>

            <p>The following option types are used:</p>

            <p><b>String</b>: A text string, commonly an identifier, password, etc.</p>

            <p>Command line example: <br-setting>--stanza=demo</br-setting><br/>Configuration file example: <br-setting>repo1-cipher-pass=zWaf6XtpjIVZC5444yXB...</br-setting></p>

            <p><b>Path</b>: Used to uniquely identify a location in a directory structure. Paths must begin with /, double // is not allowed, and no ending / is expected.</p>

            <p>Command line example: <br-setting>--repo1-path=/var/lib/pgbackrest</br-setting><br/>Configuration file example: <br-setting>repo1-path=/var/lib/pgbackrest</br-setting></p>

            <p><b>Boolean</b>: Enables or disables the option. Only y/n are valid argument values.</p>

            <p>Command line examples: <br-setting>--start-fast</br-setting>, <br-setting>--no-start-fast</br-setting>, <br-setting>--start-fast=y</br-setting>, <br-setting>--start-fast=n</br-setting><br/>Configuration file examples: <br-setting>start-fast=y</br-setting>, <br-setting>start-fast=n</br-setting></p>

            <p><b>Integer</b>: Used for ports, retention/retry counts, parallel processes allowed, etc.</p>

            <p>Command line example: <br-setting>--compress-level=3</br-setting><br/>Configuration file example: <br-setting>pg1-port=5432</br-setting></p>

            <p><b>Size</b>: Used for buffer sizes, disk usage, etc. Size can be specified in bytes (default) or KiB, MiB, GiB, TiB, or PiB where the multiplier is a power of 1024. For example, the case-insensitive value 5GiB (or 5GB, 5g) can be used instead of 5368709120. Fractional values such as 2.5GiB are not allowed, use 2560MiB instead.</p>

            <p>Command line example: <br-setting>--archive-get-queue-max=1GiB</br-setting><br/>Configuration file example: <br-setting>buffer-size=2MiB</br-setting></p>

            <p><b>Time</b>: Time in seconds.</p>

            <p>Command line example: <br-setting>--io-timeout=90</br-setting><br/>Configuration file example: <br-setting>db-timeout=600</br-setting></p>

            <p><b>List</b>: Option may be provided multiple times.</p>

            <p>Command line example: <br-setting>--db-exclude=db1 --db-exclude=db2 --db-exclude=db5</br-setting><br/>Configuration file example, each on its own line: <br-setting>db-exclude=db1 db-exclude=db2 db-exclude=db5</br-setting></p>

            <p><b>Key/Value</b>: Option may be provided multiple times in the form <id>key=value</id>.</p>

            <p>Command line example: <br-setting>--tablespace-map=ts_01=/db/ts_01 --tablespace-map=ts_02=/db/ts_02</br-setting><br/>Configuration file example, each on its own line: <br-setting>tablespace-map=ts_01=/db/ts_01 tablespace-map=ts_02=/db/ts_02</br-setting></p>
        </text>

        <config-section-list title="Settings">
            <config-section id="log" name="Log">
                <text>
                    <p>The <setting>log</setting> section defines logging-related settings.</p>

                    <admonition type="caution">Trace-level logging may expose secrets such as keys and passwords. Use with caution!</admonition>
                </text>

                <config-key-list>
                    <config-key id="log-level-file" name="File Log Level">
                        <summary>Level for file logging.</summary>

                        <text>
                            <p>The following log levels are supported:</p>

                            <list>
                                <list-item><id>off</id> - No logging at all (not recommended)</list-item>
                                <list-item><id>error</id> - Log only errors</list-item>
                                <list-item><id>warn</id> - Log warnings and errors</list-item>
                                <list-item><id>info</id> - Log info, warnings, and errors</list-item>
                                <list-item><id>detail</id> - Log detail, info, warnings, and errors</list-item>
                                <list-item><id>debug</id> - Log debug, detail, info, warnings, and errors</list-item>
                                <list-item><id>trace</id> - Log trace (very verbose debugging), debug, info, warnings, and errors</list-item>
                            </list>
                        </text>

                        <example>debug</example>
                    </config-key>

                    <config-key id="log-level-console" name="Console Log Level">
                        <summary>Level for console logging.</summary>

                        <text>
                            <p>The following log levels are supported:</p>

                            <list>
                                <list-item><id>off</id> - No logging at all (not recommended)</list-item>
                                <list-item><id>error</id> - Log only errors</list-item>
                                <list-item><id>warn</id> - Log warnings and errors</list-item>
                                <list-item><id>info</id> - Log info, warnings, and errors</list-item>
                                <list-item><id>detail</id> - Log detail, info, warnings, and errors</list-item>
                                <list-item><id>debug</id> - Log debug, detail, info, warnings, and errors</list-item>
                                <list-item><id>trace</id> - Log trace (very verbose debugging), debug, info, warnings, and errors</list-item>
                            </list>
                        </text>

                        <example>error</example>
                    </config-key>

                    <config-key id="log-level-stderr" name="Std Error Log Level">
                        <summary>Level for stderr logging.</summary>

                        <text>
                            <p>Specifies which log levels will output to <id>stderr</id> rather than <id>stdout</id> (specified by <br-option>log-level-console</br-option>). The timestamp and process will not be output to <id>stderr</id>.</p>

                            <p>The following log levels are supported:</p>

                            <list>
                                <list-item><id>off</id> - No logging at all (not recommended)</list-item>
                                <list-item><id>error</id> - Log only errors</list-item>
                                <list-item><id>warn</id> - Log warnings and errors</list-item>
                                <list-item><id>info</id> - Log info, warnings, and errors</list-item>
                                <list-item><id>detail</id> - Log detail, info, warnings, and errors</list-item>
                                <list-item><id>debug</id> - Log debug, detail, info, warnings, and errors</list-item>
                                <list-item><id>trace</id> - Log trace (very verbose debugging), debug, info, warnings, and errors</list-item>
                            </list>
                        </text>

                        <example>error</example>
                    </config-key>

                    <config-key id="log-path" name="Log Path">
                        <summary>Path where log files are stored.</summary>

                        <text>
                            <p>The log path provides a location for <backrest/> to store log files. Note that if <setting>log-level-file=off</setting> then no log path is required.</p>
                        </text>

                        <example>/backup/db/log</example>
                    </config-key>

                    <config-key id="log-timestamp" name="Log Timestamp">
                        <summary>Enable timestamp in logging.</summary>

                        <text>
                            <p>Enables the timestamp in console and file logging. This option is disabled in special situations such as generating documentation.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="log-subprocess" name="Log Subprocesses">
                        <summary>Enable logging in subprocesses.</summary>

                        <text>
                            <p>Enable file logging for any subprocesses created by this process using the log level specified by <br-option>log-level-file</br-option>.</p>
                        </text>

                        <example>y</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="general" name="General">
                <text>
                    <p>The <setting>general</setting> section defines options that are common for many commands.</p>
                </text>

                <config-key-list>
                    <config-key id="beta" name="Allow Beta Features">
                        <summary>Allow beta features.</summary>

                        <text>
                            <p>Allow beta features to be enabled but do not actually enable them. Beta features need to be separately enabled using related options.</p>
                        </text>

                        <example>2MiB</example>
                    </config-key>

                    <config-key id="buffer-size" name="Buffer Size">
                        <summary>Buffer size for I/O operations.</summary>

                        <text>
                            <p>Buffer size used for copy, compress, encrypt, and other operations. The number of buffers used depends on options and each operation may use additional memory, e.g. <id>gz</id> compression may use an additional 256KiB of memory.</p>

                            <p>Allowed values are <id>16KiB</id>, <id>32KiB</id>, <id>64KiB</id>, <id>128KiB</id>, <id>256KiB</id>, <id>512KiB</id>, <id>1MiB</id>, <id>2MiB</id>, <id>4MiB</id>, <id>8MiB</id>, and <id>16MiB</id>.</p>
                        </text>

                        <example>2MiB</example>
                    </config-key>

                    <config-key id="cmd" name="{[project]} Command">
                        <summary><backrest/> command.</summary>

                        <text>
                            <p><backrest/> may generate a command string, e.g. when the <cmd>restore</cmd> command generates the <pg-setting>restore_command</pg-setting> setting. The command used to run the <backrest/> process will be used in this case unless the <br-option>cmd</br-option> option is provided.</p>

                            <admonition type="caution">Wrapping the <backrest/> command may cause unpredictable behavior and is not recommended.</admonition>
                        </text>

                        <example>/var/lib/pgsql/bin/pgbackrest_wrapper.sh</example>
                    </config-key>

                    <config-key id="cmd-ssh" name="SSH Client Command">
                        <summary>SSH client command.</summary>

                        <text>
                            <p>Use a specific SSH client command when an alternate is desired or the <file>ssh</file> command is not in $PATH.</p>
                        </text>

                        <example>/usr/bin/ssh</example>
                    </config-key>

                    <config-key id="compress" name="Compress">
                        <summary>Use file compression.</summary>

                        <text>
                            <p>Backup files are compatible with command-line compression tools.</p>

                            <p>This option is now deprecated. The <setting>compress-type</setting> option should be used instead.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="compress-type" name="Compress Type">
                        <summary>File compression type.</summary>

                        <text>
                            <p>The following compression types are supported:</p>

                            <list>
                                <list-item><id>none</id> - no compression</list-item>
                                <list-item><id>bz2</id> - bzip2 compression format</list-item>
                                <list-item><id>gz</id> - gzip compression format</list-item>
                                <list-item><id>lz4</id> - lz4 compression format (not available on all platforms)</list-item>
                                <list-item><id>zst</id> - Zstandard compression format (not available on all platforms)</list-item>
                            </list>
                        </text>

                        <example>none</example>
                    </config-key>

                    <config-key id="compress-level" name="Compress Level">
                        <summary>File compression level.</summary>

                        <text>
                            <p>Sets the level to be used for file compression when <setting>compress-type</setting> does not equal <id>none</id> or <setting>compress=y</setting> (deprecated).</p>
                        </text>

                        <allow>0-9</allow>
                        <example>9</example>
                    </config-key>

                    <config-key id="compress-level-network" name="Network Compress Level">
                        <summary>Network compression level.</summary>

                        <text>
                            <p>Sets the network compression level when <setting>compress-type=none</setting> and the command is not run on the same host as the repository. Compression is used to reduce network traffic. When <setting>compress-type</setting> does not equal <id>none</id> the <setting>compress-level-network</setting> setting is ignored and <setting>compress-level</setting> is used instead so that the file is only compressed once.</p>
                        </text>

                        <allow>0-9</allow>
                        <example>1</example>
                    </config-key>

                    <config-key id="db-timeout" name="Database Timeout">
                        <summary>Database query timeout.</summary>

                        <text>
                            <p>Sets the timeout, in seconds, for queries against the database. This includes the backup start/stop functions which can each take a substantial amount of time. Because of this the timeout should be kept high unless you know that these functions will return quickly (i.e. if you have set <setting>start-fast=y</setting> and you know that the database cluster will not generate many WAL segments during the backup).</p>

                            <admonition type="note">The <br-option>db-timeout</br-option> option must be less than the <br-option>protocol-timeout</br-option> option.</admonition>
                        </text>

                        <example>600</example>
                    </config-key>

                    <config-key id="delta" name="Delta">
                        <summary>Restore or backup using checksums.</summary>

                        <text>
                            <p>During a restore, by default the <postgres/> data and tablespace directories are expected to be present but empty. This option performs a delta restore using checksums.</p>

                            <p>During a backup, this option will use checksums instead of the timestamps to determine if files will be copied.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="io-timeout" name="I/O Timeout">
                        <summary>I/O timeout.</summary>

                        <text>
                            <p>Timeout, in seconds, used for connections and read/write operations.</p>

                            <p>Note that the entire read/write operation does not need to complete within this timeout but <i>some</i> progress must be made, even if it is only a single byte.</p>
                        </text>

                        <example>120</example>
                    </config-key>

                    <config-key id="job-retry" name="Job Retry Count">
                        <summary>Retry count for local jobs.</summary>

                        <text>
                            <p>The number of retries for jobs run in the local process, e.g. file backup.</p>
                        </text>

                        <example>5</example>
                    </config-key>

                    <config-key id="job-retry-interval" name="Job Retry Interval">
                        <summary>Retry interval after first retry.</summary>

                        <text>
                            <p>The first retry is always performed immediately. This option specifies the interval to wait (in seconds) before performing each additional retry.</p>
                        </text>

                        <example>30</example>
                    </config-key>

                    <config-key id="lock-path" name="Lock Path">
                        <summary>Path where lock files are stored.</summary>

                        <text>
                            <p>The lock path provides a location for <backrest/> to create lock files to prevent conflicting operations from being run concurrently.</p>
                        </text>

                        <example>/backup/db/lock</example>
                    </config-key>

                    <config-key id="neutral-umask" name="Neutral Umask">
                        <summary>Use a neutral umask.</summary>

                        <text>
                            <p>Sets the umask to 0000 so modes in the repository are created in a sensible way. The default directory mode is 0750 and default file mode is 0640. The lock and log directories set the directory and file mode to 0770 and 0660 respectively.</p>

                            <p>To use the executing user's umask instead specify <setting>neutral-umask=n</setting> in the config file or <setting>--no-neutral-umask</setting> on the command line.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="spool-path" name="Spool Path">
                        <summary>Path where transient data is stored.</summary>

                        <text>
                            <p>This path is used to store data for the asynchronous <cmd>archive-push</cmd> and <cmd>archive-get</cmd> command.</p>

                            <p>The asynchronous <cmd>archive-push</cmd> command writes acknowledgements into the spool path when it has successfully stored WAL in the archive (and errors on failure) so the foreground process can quickly notify <postgres/>. Acknowledgement files are very small (zero on success and a few hundred bytes on error).</p>

                            <p>The asynchronous <cmd>archive-get</cmd> command queues WAL in the spool path so it can be provided very quickly when <postgres/> requests it. Moving files to <postgres/> is most efficient when the spool path is on the same filesystem as <path>pg_xlog</path>/<path>pg_wal</path>. However, it is not recommended to place the spool path <i>within</i> the <path>pg_xlog</path>/<path>pg_wal</path> directory as this may cause issues for <postgres/> utilities such as <file>pg_rewind</file>.</p>

                            <p>The data stored in the spool path is not strictly temporary since it can and should survive a reboot. However, loss of the data in the spool path is not a problem. <backrest/> will simply recheck each WAL segment to ensure it is safely archived for <cmd>archive-push</cmd> and rebuild the queue for <cmd>archive-get</cmd>.</p>

                            <p>The spool path is intended to be located on a local Posix-compatible filesystem, not a remote filesystem such as <proper>NFS</proper> or <proper>CIFS</proper>.</p>
                        </text>

                        <example>/backup/db/spool</example>
                    </config-key>

                    <config-key id="process-max" name="Process Maximum">
                        <summary>Max processes to use for compress/transfer.</summary>

                        <text>
                            <p>Each process will perform compression and transfer to make the command run faster, but don't set <setting>process-max</setting> so high that it impacts database performance.</p>
                        </text>

                        <example>4</example>
                    </config-key>

                    <config-key id="protocol-timeout" name="Protocol Timeout">
                        <summary>Protocol timeout.</summary>

                        <text>
                            <p>Sets the timeout, in seconds, that the local or remote process will wait for a new message to be received on the protocol layer. This prevents processes from waiting indefinitely for a message.</p>

                            <admonition type="note">The <br-option>protocol-timeout</br-option> option must be greater than the <br-option>db-timeout</br-option> option.</admonition>
                        </text>

                        <example>630</example>
                    </config-key>

                    <config-key id="sck-block" name="Socket Blocking">
                        <summary>Socket blocking enable.</summary>

                        <text>
                            <p>Enable blocking on socket connections.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="sck-keep-alive" name="Keep Alive">
                        <summary>Keep-alive enable.</summary>

                        <text>
                            <p>Enables keep-alive messages on socket connections.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                   <config-key id="tcp-keep-alive-count" name="Keep Alive Count">
                        <summary>Keep-alive count.</summary>

                        <text>
                            <p>Specifies the number of TCP keep-alive messages that can be lost before the connection is considered dead.</p>

                            <p>This option is available on systems that support the <code>TCP_KEEPCNT</code> socket option.</p>
                        </text>

                        <example>3</example>
                    </config-key>

                    <config-key id="tcp-keep-alive-idle" name="Keep Alive Idle">
                        <summary>Keep-alive idle time.</summary>

                        <text>
                            <p>Specifies the amount of time (in seconds) with no network activity after which the operating system should send a TCP keep-alive message.</p>

                            <p>This option is available on systems that support the <code>TCP_KEEPIDLE</code> socket option.</p>
                        </text>

                        <example>60</example>
                    </config-key>

                    <config-key id="tcp-keep-alive-interval" name="Keep Alive Interval">
                        <summary>Keep-alive interval time.</summary>

                        <text>
                            <p>Specifies the amount of time (in seconds) after which a TCP keep-alive message that has not been acknowledged should be retransmitted.</p>

                            <p>This option is available on systems that support the <code>TCP_KEEPINTVL</code> socket option.</p>
                        </text>

                        <example>30</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="maintainer" name="Maintainer">
                <text>
                    <p>Maintainer options are intended to support <postgres/> forks. The proper settings should be determined by the fork maintainer and then communicated to users of the fork.</p>

                    <admonition type="warning">Improper use of these options may lead to unexpected behavior or data corruption.</admonition>

                    <p>It is the responsibility of the fork maintainer to test <backrest/> with the required options. <backrest/> does not guarantee compatibility with any fork.</p>
                </text>

                <config-key-list>
                    <config-key id="archive-header-check" name="Check WAL Headers">
                        <summary>Check PostgreSQL version/id in WAL headers.</summary>

                        <text>
                            <p>Enabled by default, this option checks the WAL header against the <postgres/> version and system identifier to ensure that the WAL is being copied to the correct stanza. This is in addition to checking <file>pg_control</file> against the stanza and verifying that WAL is being copied from the same <postgres/> data directory where <file>pg_control</file> is located.</p>

                            <p>Therefore, disabling this check is fairly safe but should only be done when needed, e.g. if the WAL is encrypted.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="page-header-check" name="Page Header Check">
                        <summary>Check PostgreSQL page headers.</summary>

                        <text>
                            <p>Enabled by default, this option adds page header checks.</p>

                            <p>Disabling this option should be avoided except when necessary, e.g. if pages are encrypted.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="pg-version-force" name="Force PostgreSQL Version">
                        <summary>Force <postgres/> version.</summary>

                        <text>
                            <p>The specified <postgres/> version will be used instead of the version automatically detected by reading <file>pg_control</file> or WAL headers. This is mainly useful for <postgres/> forks or development versions where those values are different from the release version. The version reported by <postgres/> via `server_version_num` must match the forced version.</p>

                            <admonition type="warning">Be cautious when using this option because <file>pg_control</file> and WAL headers will still be read with the expected format for the specified version, i.e. the format from the official open-source version of <postgres/>. If the fork or development version changes the format of the fields that <backrest/> depends on it will lead to unexpected behavior. In general, this option will only work as expected if the fork adds all custom struct members <i>after</i> the standard <postgres/> members.</admonition>
                        </text>

                        <example>15</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="repository" name="Repository">
                <text>
                    <p>The <setting>repository</setting> section defines options used to configure the repository.</p>

                    <p><b>Indexing</b>: All <setting>repo-</setting> options are indexed to allow for configuring multiple repositories. For example, a single repository is configured with the <setting>repo1-path</setting>, <setting>repo1-host</setting>, etc. options. If there is more than one repository configured and the <br-option>{[dash]}-repo</br-option> option is not specified for a command, the repositories will be acted upon in highest priority order (e.g. repo1 then repo2).</p>

                    <p>The <setting>repo-retention-*</setting> options define how long backups will be retained. Expiration only occurs when the count of complete backups exceeds the allowed retention. In other words, if <setting>repo1-retention-full-type</setting> is set to <setting>count</setting> (default) and <setting>repo1-retention-full</setting> is set to 2, then there must be 3 complete backups before the oldest will be expired. If <setting>repo1-retention-full-type</setting> is set to <setting>time</setting> then <setting>repo1-retention-full</setting> represents days so there must be at least that many days worth of full backups before expiration can occur. Make sure you always have enough space for retention + 1 backups.</p>
                </text>

                <config-key-list>
                    <config-key id="repo-azure-account" name="Azure Repository Account">
                        <summary>Azure repository account.</summary>

                        <text>
                            <p>Azure account used to store the repository.</p>
                        </text>

                        <example>pg-backup</example>
                    </config-key>

                    <config-key id="repo-azure-container" name="Azure Repository Container">
                        <summary>Azure repository container.</summary>

                        <text>
                            <p>Azure container used to store the repository.</p>

                            <p><backrest/> repositories can be stored in the container root by setting <br-option>repo-path=/</br-option> but it is usually best to specify a prefix, such as <path>/repo</path>, so logs and other Azure-generated content can also be stored in the container.</p>
                        </text>

                        <example>pg-backup</example>
                    </config-key>

                    <config-key id="repo-azure-endpoint" name="Azure Repository Endpoint">
                        <summary>Azure repository endpoint.</summary>

                        <text>
                            <p>Endpoint used to connect to the blob service. The default is generally correct unless using Azure Government.</p>

                            <p>For custom/test configurations the <setting>repo-storage-ca-file</setting>, <setting>repo-storage-ca-path</setting>, <setting>repo-storage-host</setting>, <setting>repo-storage-port</setting>, and <setting>repo-storage-verify-tls</setting> options may be useful.</p>
                        </text>

                        <example>blob.core.usgovcloudapi.net</example>
                    </config-key>

                    <config-key id="repo-azure-key" name="Azure Repository Key">
                        <summary>Azure repository key.</summary>

                        <text>
                            <p>A shared key or shared access signature depending on the <br-option>repo-azure-key-type</br-option> option.</p>
                        </text>

                        <example>T+9+aov82qNhrcXSNGZCzm9mjd4d75/oxxOr6r1JVpgTLA==</example>
                    </config-key>

                    <config-key id="repo-azure-key-type" name="Azure Repository Key Type">
                        <summary>Azure repository key type.</summary>

                        <text>
                            <p>The following types are supported for authorization:</p>

                            <list>
                                <list-item><id>shared</id> - Shared key</list-item>
                                <list-item><id>sas</id> - Shared access signature</list-item>
                            </list>
                        </text>

                        <example>sas</example>
                    </config-key>

                    <config-key id="repo-azure-uri-style" name="Azure Repository URI Style">
                        <summary>Azure URI Style.</summary>

                        <text>
                            <p>The following URI styles are supported:</p>

                            <list>
                                <list-item><id>host</id> - Connect to <id>account.endpoint</id> host.</list-item>
                                <list-item><id>path</id> - Connect to <id>endpoint</id> host and prepend account to URIs.</list-item>
                            </list>
                        </text>

                        <example>path</example>
                    </config-key>

                    <config-key id="repo-block" name="Block Incremental Backup">
                        <summary>Enable block incremental backup.</summary>

                        <text>
                            <p>Block incremental allows for more granular backups by splitting files into blocks that can be backed up independently. This saves space in the repository and can improve delta restore performance because individual blocks can be fetched without reading the entire file from the repository.</p>

                            <admonition type="note">The <br-option>repo-bundle</br-option> option must be enabled before <br-option>repo-block</br-option> can be enabled.</admonition>

                            <p>The block size for a file is determined based on the file size and age. Generally, older/larger files will get larger block sizes. If a file is old enough, it will not be backed up using block incremental.</p>

                            <p>Block incremental is most efficient when enabled for all backup types, including full. This makes the full a bit larger but subsequent differential and incremental backups can make use of the block maps generated by the full backup to save space.</p>
                       </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="repo-block-age-map" name="Block Incremental Age Map">
                        <summary>Block incremental age map.</summary>

                        <text>
                            <p>Map file age (in days) to a block multiplier. Files that have not been modified recently are less likely to be modified in the future, so the block size is multiplied to reduce the map size. By default, if the file is old enough it will not be stored as a block incremental.</p>
                       </text>

                        <example>7=2</example>
                        <example>14=4</example>
                    </config-key>

                    <config-key id="repo-block-checksum-size-map" name="Block Incremental Checksum Size Map">
                        <summary>Block incremental checksum size map.</summary>

                        <text>
                            <p>Map block size to checksum size. Smaller checksums save space in the map but may not be able to reliably detect changes in the block.</p>
                       </text>

                        <example>32KiB=7</example>
                        <example>128KiB=8</example>
                    </config-key>

                    <config-key id="repo-block-size-map" name="Block Incremental Size Map">
                        <summary>Block incremental size map.</summary>

                        <text>
                            <p>Map file size to block size. Block size is the minimum unit that will be stored in the block incremental. Smaller sizes allow for more granular incremental backups but larger sizes mean smaller maps.</p>
                       </text>

                        <example>16KiB=8KiB</example>
                        <example>128KiB=16KiB</example>
                        <example>512KiB=32KiB</example>
                    </config-key>

                    <config-key id="repo-block-size-super" name="Block Incremental Super Block Size">
                        <summary>Block incremental super block size.</summary>

                        <text>
                            <p>A super block contains multiple blocks to improve compression efficiency. The disadvantage is that block reads must read from the beginning of the super block.</p>
                       </text>

                        <example>2MiB</example>
                    </config-key>

                    <config-key id="repo-block-size-super-full" name="Block Incremental Full Super Block Size">
                        <summary>Block incremental full super block size.</summary>

                        <text>
                            <p>Super block size for full backups. This is generally larger than <br-option>repo-block-size-super</br-option> because it is likely that many blocks will need to be restored from the full backup so the larger super block size is not a disadvantage.</p>
                       </text>

                        <example>8MiB</example>
                    </config-key>

                    <config-key id="repo-bundle" name="Repository Bundles">
                        <summary>Bundle files in repository.</summary>

                        <text>
                            <p>Bundle (combine) smaller files to reduce the total number of files written to the repository. Writing fewer files is generally more efficient, especially on object stores such as <proper>S3</proper>. In addition, zero-length files are not stored (except in the manifest), which saves time and space.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="repo-bundle-size" name="Repository Bundle Size">
                        <summary>Target size for file bundles.</summary>

                        <text>
                            <p>Defines the total size of files that will be added to a single bundle. Most bundles will be smaller than this size but it is possible that some will be slightly larger, so do not set this option to the maximum size that your file system allows.</p>

                            <p>In general, it is not a good idea to set this option too high because retries will need to redo the entire bundle.</p>
                        </text>

                        <example>10MiB</example>
                    </config-key>

                    <config-key id="repo-bundle-limit" name="Repository Bundle Limit">
                        <summary>Limit for file bundles.</summary>

                        <text>
                            <p>Size limit for files that will be included in bundles. Files larger than this size will be stored separately.</p>

                            <p>Bundled files cannot be reused when a backup is resumed, so this option controls the files that can be resumed, i.e. higher values result in fewer resumable files.</p>
                        </text>

                        <example>10MiB</example>
                    </config-key>

                    <config-key id="repo-gcs-bucket" name="GCS Repository Bucket">
                        <summary>GCS repository bucket.</summary>

                        <text>
                            <p>GCS bucket used to store the repository.</p>

                            <p><backrest/> repositories can be stored in the bucket root by setting <br-option>repo-path=/</br-option> but it is usually best to specify a prefix, such as <path>/repo</path>, so logs and other GCS-generated content can also be stored in the bucket.</p>
                        </text>

                        <example>/pg-backup</example>
                    </config-key>

                    <config-key id="repo-gcs-endpoint" name="GCS Repository Endpoint">
                        <summary>GCS repository endpoint.</summary>

                        <text>
                            <p>Endpoint used to connect to the storage service. May be updated to use a local GCS server or alternate endpoint.</p>
                        </text>

                        <example>localhost</example>
                    </config-key>

                    <config-key id="repo-gcs-key" name="GCS Repository Key">
                        <summary>GCS repository key.</summary>

                        <text>
                            <p>A token or service key file depending on the <br-option>repo-gcs-key-type</br-option> option.</p>
                        </text>

                        <example>/etc/pgbackrest/gcs-key.json</example>
                    </config-key>

                    <config-key id="repo-gcs-key-type" name="GCS Repository Key Type">
                        <summary>GCS repository key type.</summary>

                        <text>
                            <p>The following types are supported for authorization:</p>

                            <list>
                                <list-item><id>auto</id> - Authorize using the instance service account.</list-item>
                                <list-item><id>service</id> - Service account from locally stored key.</list-item>
                                <list-item><id>token</id> - For local testing, e.g. <file>fakegcs</file>.</list-item>
                            </list>

                            <p>When <br-option>repo-gcs-key-type=service</br-option> the credentials will be reloaded when the authentication token is renewed.</p>
                        </text>

                        <example>auto</example>
                    </config-key>

                    <config-key id="repo-gcs-user-project" name="GCS Repository Project ID">
                        <summary>GCS project ID.</summary>

                        <text>
                            <p>GCS project ID used to determine request billing.</p>
                        </text>

                        <example>my-project</example>
                    </config-key>

                    <config-key id="repo-host-type" name="Repository Host Protocol Type">
                        <summary>Repository host protocol type.</summary>

                        <text>
                            <p>The following protocol types are supported:</p>

                            <list>
                                <list-item><id>ssh</id> - Secure Shell.</list-item>
                                <list-item><id>tls</id> - <backrest/> TLS server.</list-item>
                            </list>
                        </text>

                        <example>tls</example>
                    </config-key>

                    <config-key id="repo-host" name="Repository Host">
                        <summary>Repository host when operating remotely.</summary>

                        <text>
                            <p>When backing up and archiving to a locally mounted filesystem this setting is not required.</p>
                        </text>

                        <example>repo1.domain.com</example>
                    </config-key>

                    <config-key id="repo-host-ca-file" name="Repository Host Certificate Authority File">
                        <summary>Repository host certificate authority file.</summary>

                        <text>
                            <p>Use a CA file other than the system default for connecting to the repository host.</p>
                        </text>

                        <example>/etc/pki/tls/certs/ca-bundle.crt</example>
                    </config-key>

                    <config-key id="repo-host-ca-path" name="Repository Host Certificate Authority Path">
                        <summary>Repository host certificate authority path.</summary>

                        <text>
                            <p>Use a CA path other than the system default for connecting to the repository host.</p>
                        </text>

                        <example>/etc/pki/tls/certs</example>
                    </config-key>

                    <config-key id="repo-host-cert-file" name="Repository Host Certificate File">
                        <summary>Repository host certificate file.</summary>

                        <text>
                            <p>Sent to repository host to prove client identity.</p>
                        </text>

                        <example>/path/to/client.crt</example>
                    </config-key>

                    <config-key id="repo-host-key-file" name="Repository Host Key File">
                        <summary>Repository host key file.</summary>

                        <text>
                            <p>Proves client certificate was sent by owner.</p>
                        </text>

                        <example>/path/to/client.key</example>
                    </config-key>

                    <config-key id="repo-host-cmd" name="Repository Host Command">
                        <summary>Repository host <backrest/> command.</summary>

                        <text>
                            <p>Required only if the path to the <backrest/> command is different on the local and repository hosts. If not defined, the repository host command will be set the same as the local command.</p>
                        </text>

                        <example>/usr/lib/backrest/bin/pgbackrest</example>
                    </config-key>

                    <config-key id="repo-host-config" name="Repository Host Configuration">
                        <summary><backrest/> repository host configuration file.</summary>

                        <text>
                            <p>Sets the location of the configuration file on the repository host. This is only required if the repository host configuration file is in a different location than the local configuration file.</p>
                        </text>

                        <example>/conf/pgbackrest/pgbackrest.conf</example>
                    </config-key>

                    <config-key id="repo-host-config-include-path" name="Repository Host Configuration Include Path">
                        <summary><backrest/> repository host configuration include path.</summary>

                        <text>
                            <p>Sets the location of the configuration include path on the repository host. This is only required if the repository host configuration include path is in a different location than the local configuration include path.</p>
                        </text>

                        <example>/conf/pgbackrest/conf.d</example>
                    </config-key>

                    <config-key id="repo-host-config-path" name="Repository Host Configuration Path">
                        <summary><backrest/> repository host configuration path.</summary>

                        <text>
                            <p>Sets the location of the configuration path on the repository host. This is only required if the repository host configuration path is in a different location than the local configuration path.</p>
                        </text>

                        <example>/conf/pgbackrest</example>
                    </config-key>

                    <config-key id="repo-host-user" name="Repository Host User">
                        <summary>Repository host user when <setting>repo-host</setting> is set.</summary>

                        <text>
                            <p>Defines the user that will be used for operations on the repository host. Preferably this is not the <id>postgres</id> user but rather some other user like <id>pgbackrest</id>. If <postgres/> runs on the repository host the <id>postgres</id> user can be placed in the <id>pgbackrest</id> group so it has read permissions on the repository without being able to damage the contents accidentally.</p>
                        </text>

                        <example>repo-user</example>
                    </config-key>

                    <config-key id="repo-host-port" name="Repository Host Port">
                        <summary>Repository host port when <setting>repo-host</setting> is set.</summary>

                        <text>
                            <p>Use this option to specify a non-default port for the repository host protocol.</p>

                            <admonition type="note">When <setting>repo-host-type=ssh</setting> there is no default for <setting>repo-host-port</setting>. In this case the port will be whatever is configured for the command specified by <setting>cmd-ssh</setting>.</admonition>
                        </text>

                        <example>25</example>
                    </config-key>

                    <config-key id="repo-hardlink" name="Repository Hardlink">
                        <summary>Hardlink files between backups in the repository.</summary>

                        <text>
                            <p>Enable hard-linking of files in differential and incremental backups to their full backups. This gives the appearance that each backup is a full backup at the file-system level. Be careful, though, because modifying files that are hard-linked can affect all the backups in the set.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="repo-local" name="Repository Locality">
                        <summary>Repository is local.</summary>

                        <text>
                            <p>Indicates that the repository for the specified index is local and any repository host settings for that index (e.g. <setting>repo1-host</setting>) should be ignored.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="repo-path" name="Repository Path">
                        <summary>Path where backups and archive are stored.</summary>

                        <text>
                            <p>The repository is where <backrest/> stores backups and archives WAL segments.</p>

                            <p>It may be difficult to estimate in advance how much space you'll need. The best thing to do is take some backups then record the size of different types of backups (full/incr/diff) and measure the amount of WAL generated per day. This will give you a general idea of how much space you'll need, though of course requirements will likely change over time as your database evolves.</p>
                        </text>

                        <example>/backup/db/backrest</example>
                    </config-key>

                    <config-key id="repo-retention-full" name="Full Retention">
                        <summary>Full backup retention count/time.</summary>

                        <text>
                            <p>When a full backup expires, all differential and incremental backups associated with the full backup will also expire. When the option is not defined a warning will be issued. If indefinite retention is desired then set the option to the max value.</p>
                        </text>

                        <example>2</example>
                    </config-key>

                    <config-key id="repo-retention-full-type" name="Full Retention Type">
                        <summary>Retention type for full backups.</summary>

                        <text>
                            <p>Determines whether the <setting>repo-retention-full</setting> setting represents a time period (days) or count of full backups to keep.</p>

                            <p>If set to <setting>time</setting> then full backups older than <setting>repo-retention-full</setting> will be removed from the repository if there is at least one other backup that is equal to or greater than the <setting>repo-retention-full</setting> setting. For example, if <setting>repo-retention-full</setting> is 30 (days) and there are 2 full backups: one 25 days old and one 35 days old, no full backups will be expired because expiring the 35 day old backup would leave only the 25 day old backup, which would violate the 30 day retention policy of having at least one backup 30 days old before an older one can be expired. Archived WAL older than the oldest full backup remaining will be automatically expired unless <setting>repo-retention-archive-type</setting> and <setting>repo-retention-archive</setting> are explicitly set.</p>

                            <p>If set to <setting>count</setting> then full backups that exceed <setting>repo-retention-full</setting> will be expired. For example, if <setting>repo-retention-full</setting> is <setting>4</setting> and a fifth full backup is completed, then the oldest full backup will be expired to keep the count at 4.</p>

                            <p>Note that a backup must be successfully completed before it will be considered for retention. For example, if <setting>repo-retention-full-type</setting> is <setting>count</setting> and <setting>repo-retention-full</setting> is <setting>2</setting>, then there must be 3 complete full backups before the oldest will be expired.</p>
                        </text>

                        <example>time</example>
                    </config-key>

                    <config-key id="repo-retention-diff" name="Differential Retention">
                        <summary>Number of differential backups to retain.</summary>

                        <text>
                            <p>When a differential backup expires, all incremental backups associated with the differential backup will also expire. When not defined all differential backups will be kept until the full backups they depend on expire.</p>

                            <p>Note that full backups are included in the count of differential backups for the purpose of expiration. This slightly reduces the number of differential backups that need to be retained in most cases.</p>
                        </text>

                        <example>3</example>
                    </config-key>

                    <config-key id="repo-retention-archive-type" name="Archive Retention Type">
                        <summary>Backup type for WAL retention.</summary>

                        <text>
                            <p>If set to <setting>full</setting> <backrest/> will keep archive logs for the number of full backups defined by <setting>repo-retention-archive</setting>. If set to <setting>diff</setting> (differential) <backrest/> will keep archive logs for the number of full and differential backups defined by <setting>repo-retention-archive</setting>, meaning if the last backup taken was a full backup, it will be counted as a differential for the purpose of repo-retention. If set to <setting>incr</setting> (incremental) <backrest/> will keep archive logs for the number of full, differential, and incremental backups defined by <setting>repo-retention-archive</setting>. It is recommended that this setting not be changed from the default which will only expire WAL in conjunction with expiring full backups.</p>
                        </text>

                        <example>diff</example>
                    </config-key>

                    <config-key id="repo-retention-archive" name="Archive Retention">
                        <summary>Number of backups worth of continuous WAL to retain.</summary>

                        <text>
                            <admonition type="note">WAL segments required to make a backup consistent are always retained until the backup is expired regardless of how this option is configured.</admonition>

                            <p>If this value is not set and <setting>repo-retention-full-type</setting> is <setting>count</setting> (default), then the archive to expire will default to the <setting>repo-retention-full</setting> (or <setting>repo-retention-diff</setting>) value corresponding to the <setting>repo-retention-archive-type</setting> if set to <setting>full</setting> (or <setting>diff</setting>). This will ensure that WAL is only expired for backups that are already expired. If <setting>repo-retention-full-type</setting> is <setting>time</setting>, then this value will default to removing archives that are earlier than the oldest full backup retained after satisfying the <setting>repo-retention-full</setting> setting.</p>

                            <p>This option must be set if <setting>repo-retention-archive-type</setting> is set to <setting>incr</setting>. If disk space is at a premium, then this setting, in conjunction with <setting>repo-retention-archive-type</setting>, can be used to aggressively expire WAL segments. However, doing so negates the ability to perform PITR from the backups with expired WAL and is therefore <b>not</b> recommended.</p>
                        </text>

                        <example>2</example>
                    </config-key>

                    <config-key id="repo-retention-history" name="Backup History Retention">
                        <summary>Days of backup history manifests to retain.</summary>

                        <text>
                            <p>A copy of the backup manifest is stored in the <path>backup.history</path> path when a backup completes. By default these files are never expired since they are useful for data mining, e.g. measuring backup and WAL growth over time.</p>

                            <p>Set <setting>repo-retention-history</setting> to define the number of days of backup history manifests to retain. Unexpired backups are always kept in the backup history. Specify <br-option>repo-retention-history=0</br-option> to retain the backup history only for unexpired backups.</p>

                            <p>When a full backup history manifest is expired, all differential and incremental backup history manifests associated with the full backup also expire.</p>
                        </text>

                        <example>365</example>
                    </config-key>

                    <config-key id="repo-s3-key" name="S3 Repository Access Key">
                        <summary>S3 repository access key.</summary>

                        <text>
                            <p>AWS key used to access this bucket.</p>
                        </text>

                        <example>AKIAIOSFODNN7EXAMPLE</example>
                    </config-key>

                    <config-key id="repo-s3-key-secret" name="S3 Repository Secret Access Key">
                        <summary>S3 repository secret access key.</summary>

                        <text>
                            <p>AWS secret key used to access this bucket.</p>
                        </text>

                        <example>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</example>
                    </config-key>

                    <config-key id="repo-s3-key-type" name="S3 Repository Key Type">
                        <summary>S3 repository key type.</summary>

                        <text>
                            <p>The following types are supported:</p>

                            <list>
                                <list-item><id>shared</id> - Shared keys</list-item>
                                <list-item><id>auto</id> - Automatically retrieve temporary credentials</list-item>
                                <list-item><id>web-id</id> - Automatically retrieve web identity credentials</list-item>
                            </list>
                        </text>

                        <example>auto</example>
                    </config-key>

                    <config-key id="repo-s3-token" name="S3 Repository Security Token">
                        <summary>S3 repository security token.</summary>

                        <text>
                            <p>AWS security token used with temporary credentials.</p>
                        </text>

                        <example>AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22 ...</example>
                    </config-key>

                    <config-key id="repo-s3-kms-key-id" name="S3 Repository KMS Key ID">
                        <summary>S3 repository KMS key.</summary>

                        <text>
                            <p>Enables S3 server-side encryption using the specified AWS key management service key.</p>
                        </text>

                        <example>bceb4f13-6939-4be3-910d-df54dee817b7</example>
                    </config-key>

                    <config-key id="repo-s3-bucket" name="S3 Repository Bucket">
                        <summary>S3 repository bucket.</summary>

                        <text>
                            <p>S3 bucket used to store the repository.</p>

                            <p><backrest/> repositories can be stored in the bucket root by setting <br-option>repo-path=/</br-option> but it is usually best to specify a prefix, such as <path>/repo</path>, so logs and other AWS generated content can also be stored in the bucket.</p>
                        </text>

                        <example>pg-backup</example>
                    </config-key>

                    <config-key id="repo-s3-endpoint" name="S3 Repository Endpoint">
                        <summary>S3 repository endpoint.</summary>

                        <text>
                            <p>The AWS endpoint should be valid for the selected region.</p>

                            <p>For custom/test configurations the <setting>repo-storage-ca-file</setting>, <setting>repo-storage-ca-path</setting>, <setting>repo-storage-host</setting>, <setting>repo-storage-port</setting>, and <setting>repo-storage-verify-tls</setting> options may be useful.</p>
                        </text>

                        <example>s3.amazonaws.com</example>
                    </config-key>

                    <config-key id="repo-s3-role" name="S3 Repository Role">
                        <summary>S3 repository role.</summary>

                        <text>
                            <p>The AWS role name (not the full ARN) used to retrieve temporary credentials when <br-option>repo-s3-key-type=auto</br-option>.</p>
                        </text>

                        <example>authrole</example>
                    </config-key>

                    <config-key id="repo-s3-region" name="S3 Repository Region">
                        <summary>S3 repository region.</summary>

                        <text>
                            <p>The AWS region where the bucket was created.</p>
                        </text>

                        <example>us-east-1</example>
                    </config-key>

                    <config-key id="repo-s3-sse-customer-key" name="S3 Repository SSE Customer Key">
                        <summary>S3 repository SSE customer key.</summary>

                        <text>
                            <p>Enables S3 server-side encryption using the specified customer key.</p>
                        </text>

                        <example>bceb4f13-6939-4be3-910d-df54dee817b7</example>
                    </config-key>

                    <config-key id="repo-s3-requester-pays" name="S3 Repository Requestor Pays">
                        <summary>S3 repository requester pays.</summary>

                        <text>
                            <p>Enables S3 requester pays.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="repo-s3-uri-style" name="S3 Repository URI Style">
                        <summary>S3 URI Style.</summary>

                        <text>
                            <p>The following URI styles are supported:</p>

                            <list>
                                <list-item><id>host</id> - Connect to <id>bucket.endpoint</id> host.</list-item>
                                <list-item><id>path</id> - Connect to <id>endpoint</id> host and prepend bucket to URIs.</list-item>
                            </list>
                        </text>

                        <example>path</example>
                    </config-key>

                    <config-key id="repo-sftp-host" name="SFTP Repository Host">
                        <summary>SFTP repository host.</summary>

                        <text>
                            <p>The SFTP host containing the repository.</p>
                        </text>

                        <example>sftprepo.domain</example>
                    </config-key>

                    <config-key id="repo-sftp-host-fingerprint" name="SFTP Repository Host Fingerprint">
                        <summary>SFTP repository host fingerprint.</summary>

                        <text>
                            <p>SFTP repository host fingerprint generation should match the <setting>repo-sftp-host-key-hash-type</setting>. Generate the fingerprint via <code>awk '{print $2}' ssh_host_xxx_key.pub | base64 -d | (md5sum or sha1sum) -b</code>. The ssh host keys are normally found in the <path>/etc/ssh</path> directory.</p>
                        </text>

                        <example>f84e172dfead7aeeeae6c1fdfb5aa8cf</example>
                    </config-key>

                    <config-key id="repo-sftp-host-key-check-type" name="SFTP Host Key Check Type">
                        <summary>SFTP host key check type.</summary>

                        <text>
                            <p>The following SFTP host key check types are supported:</p>
                            <list>
                                <list-item><id>strict</id> - <backrest/> will never automatically add host keys to the ~/.ssh/known_hosts file, and refuses to connect to hosts whose host key has changed or is not found in the known hosts files. This option forces the user to manually add all new hosts.</list-item>
                                <list-item><id>accept-new</id> - <backrest/> will automatically add new host keys to the user's known hosts file, but will not permit connections to hosts with changed host keys.</list-item>
                                <list-item><id>fingerprint</id> - <backrest/> will check the host key against the fingerprint specified by the <br-option>repo-sftp-host-fingerprint</br-option> option.</list-item>
                                <list-item><id>none</id> - no host key checking will be performed.</list-item>
                            </list>
                        </text>

                        <default>yes</default>
                        <example>accept-new</example>
                    </config-key>

                    <config-key id="repo-sftp-host-key-hash-type" name="SFTP Repository Host Key Hash Type">
                        <summary>SFTP repository host key hash type.</summary>

                        <text>
                            <p>SFTP repository host key hash type. Declares the hash type to be used to compute the digest of the remote system's host key on SSH startup. Newer versions of <id>libssh2</id> support <id>sha256</id> in addition to md5 and sha1.</p>
                        </text>

                        <example>sha256</example>
                    </config-key>

                    <config-key id="repo-sftp-host-port" name="SFTP Repository Host Port">
                        <summary>SFTP repository host port.</summary>

                        <text>
                            <p>SFTP repository host port.</p>
                        </text>

                        <example>22</example>
                    </config-key>

                    <config-key id="repo-sftp-host-user" name="SFTP Repository Host User">
                        <summary>SFTP repository host user.</summary>

                        <text>
                            <p>User on the host used to store the repository.</p>
                        </text>

                        <example>pg-backup</example>
                    </config-key>

                    <config-key id="repo-sftp-known-host" name="SFTP Known Hosts File">
                        <summary>SFTP known hosts file.</summary>

                        <text>
                            <p>A known hosts file to search for an SFTP host match during authentication. When unspecified, <backrest/> will default to searching <file>~/.ssh/known_hosts</file>, <file>~/.ssh/known_hosts2</file>, <file>/etc/ssh/ssh_known_hosts</file>, and <file>/etc/ssh/ssh_known_hosts2</file>. If configured with one or more file paths, <backrest/> will search those for a match. File paths must be full or leading tilde paths. The <setting>repo-sftp-known-host</setting> option can be passed multiple times to specify more than one known hosts file to search. To utilize known hosts file checking <setting>repo-sftp-host-fingerprint</setting> must not be specified. See also <setting>repo-sftp-host-check-type</setting> option.</p>
                        </text>

                        <example>/home/postgres/.ssh/known_hosts</example>
                    </config-key>

                    <config-key id="repo-sftp-private-key-file" name="SFTP Repository Private Key File">
                        <summary>SFTP private key file.</summary>

                        <text>
                            <p>SFTP private key file used for authentication.</p>
                        </text>

                        <example>~/.ssh/id_ed25519</example>
                    </config-key>

                    <config-key id="repo-sftp-private-key-passphrase" name="SFTP Repository Private Key Passphrase">
                        <summary>SFTP private key passphrase.</summary>

                        <text>
                            <p>Passphrase used to access the private key. This is an optional feature when creating an SSH public/private key pair.</p>
                        </text>

                        <example>BeSureToGenerateAndUseASecurePassphrase</example>
                    </config-key>

                    <config-key id="repo-sftp-public-key-file" name="SFTP Repository Public Key File">
                        <summary>SFTP public key file.</summary>

                        <text>
                            <p>SFTP public key file used for authentication. Optional if compiled against OpenSSL, required if compiled against a different library.</p>
                        </text>

                        <example>~/.ssh/id_ed25519.pub</example>
                    </config-key>

                    <config-key id="repo-storage-ca-file" name="Repository Storage CA File">
                        <summary>Repository storage CA file.</summary>

                        <text>
                            <p>Use a CA file other than the system default for storage (e.g. S3, Azure) certificates.</p>
                        </text>

                        <example>/etc/pki/tls/certs/ca-bundle.crt</example>
                    </config-key>

                    <config-key id="repo-storage-ca-path" name="Repository Storage TLS CA Path">
                        <summary>Repository storage CA path.</summary>

                        <text>
                            <p>Use a CA path other than the system default for storage (e.g. S3, Azure) certificates.</p>
                        </text>

                        <example>/etc/pki/tls/certs</example>
                    </config-key>

                    <config-key id="repo-storage-host" name="Repository Storage Host">
                        <summary>Repository storage host.</summary>

                        <text>
                            <p>Connect to a host other than the storage (e.g. S3, Azure) endpoint. This is typically used for testing.</p>
                        </text>

                        <example>127.0.0.1</example>
                    </config-key>

                    <config-key id="repo-storage-port" name="Repository Storage Port">
                        <summary>Repository storage port.</summary>

                        <text>
                            <p>Port to use when connecting to the storage (e.g. S3, Azure) endpoint (or host if specified).</p>
                        </text>

                        <example>9000</example>
                    </config-key>

                    <config-key id="repo-storage-tag" name="Repository Storage Tag">
                        <summary>Repository storage tag(s).</summary>

                        <text>
                            <p>Specify tags that will be added to objects when the repository is an object store (e.g. S3). The option can be repeated to add multiple tags.</p>

                            <p>There is no provision in <backrest/> to modify these tags so be sure to set them correctly before running <cmd>stanza-create</cmd> to ensure uniform tags across the entire repository.</p>
                        </text>

                        <example>key1=value1</example>
                    </config-key>

                    <config-key id="repo-storage-upload-chunk-size" name="Repository Storage Upload Chunk Size">
                        <summary>Repository storage upload chunk size.</summary>

                        <text>
                            <p>Object stores such as S3 allow files to be uploaded in chunks when the file is too large to be stored in memory. Even if the file can be stored in memory, it is more memory efficient to limit the amount of memory used for uploads.</p>

                            <p>A larger chunk size will generally lead to better performance because it will minimize upload requests and allow more files to be uploaded in a single request rather than in chunks. The disadvantage is that memory usage will be higher and because the chunk buffer must be allocated per process, larger <br-option>process-max</br-option> values will lead to more memory being consumed overall.</p>

                            <p>Note that valid chunk sizes vary by storage type and by platform. For example, <proper>AWS S3</proper> has a minimum chunk size of 5MiB but <proper>S3</proper> clones may accept lower values. Terminology for chunk size varies by storage type, so when searching min/max values use <quote>part size</quote> for <proper>AWS S3</proper>, <quote>chunk size</quote> for <proper>GCS</proper>, and <quote>block size</quote> for <proper>Azure</proper>. No attempt is made to validate configured chunk sizes so selecting an invalid value will lead to errors from the storage service or undefined behavior.</p>
                        </text>

                        <example>16MiB</example>
                    </config-key>

                    <config-key id="repo-storage-verify-tls" name="Repository Storage Certificate Verify">
                        <summary>Repository storage certificate verify.</summary>

                        <text>
                            <p>This option provides the ability to enable/disable verification of the storage (e.g. S3, Azure) server TLS certificate. Disabling should only be used for testing or other scenarios where a certificate has been self-signed.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="repo-symlink" name="Repository Symlink">
                        <summary>Create symlinks within the repository.</summary>

                        <text>
                            <p>Enable creation of the <file>lastest</file> and tablespace symlinks. These symlinks are most useful when using snapshots to do in-place recovery in the repository, which is an uncommon use case.</p>

                            <p>While this feature is likely not useful for the vast majority of users it remains on by default for legacy purposes. However, it may be useful to disable symlinks for Posix-like storage that does not support them.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="repo-target-time" name="Target Time for Repository">
                        <summary>Target time for repository.</summary>

                        <text>
                            <p>The target time defines the time that commands use to read a repository on versioned storage. This allows the command to read the repository as it was at a point-in-time in order to recover data that has been deleted or corrupted by user accident or malware.</p>

                            <p>Versioned storage is supported by <proper>S3</proper>, <proper>GCS</proper>, and <proper>Azure</proper> but is generally not enabled by default. In addition to enabling versioning, it may be useful to enable object locking for <proper>S3</proper> and soft delete for <proper>GCS</proper> or <proper>Azure</proper>.</p>

                            <p>When the <br-option>repo-target-time</br-option> option is specified then the <br-option>repo</br-option> option must also be provided. It is likely that not all repository types will support versioning and in general it makes sense to target a single repository for recovery.</p>

                            <p>Note that comparisons to the storage timestamp are &lt;= the timestamp provided and milliseconds are truncated from the timestamp when provided.</p>
                        </text>

                        <example>2024-08-08 12:12:12+00</example>
                    </config-key>

                    <config-key id="repo-type" name="Repository Type">
                        <summary>Type of storage used for the repository.</summary>

                        <text>
                            <p>The following repository types are supported:</p>

                            <list>
                                <list-item><id>azure</id> - Azure Blob Storage Service</list-item>
                                <list-item><id>cifs</id> - Like <id>posix</id>, but disables links and directory fsyncs</list-item>
                                <list-item><id>gcs</id> - Google Cloud Storage</list-item>
                                <list-item><id>posix</id> - Posix-compliant file systems</list-item>
                                <list-item><id>s3</id> - AWS Simple Storage Service</list-item>
                                <list-item><id>sftp</id> - Secure File Transfer Protocol</list-item>
                            </list>

                            <p>When an <proper>NFS</proper> mount is used as a <id>posix</id> repository, the same rules apply to <backrest/> as described in the <postgres/> documentation: <link url="https://www.postgresql.org/docs/current/creating-cluster.html#CREATING-CLUSTER-FILESYSTEM">Creating a Database Cluster - File Systems</link>.</p>
                        </text>

                        <example>cifs</example>
                    </config-key>

                    <config-key id="repo-cipher-type" name="Repository Cipher Type">
                        <summary>Cipher used to encrypt the repository.</summary>

                        <text>
                            <p>The following cipher types are supported:</p>

                            <list>
                                <list-item><id>none</id> - The repository is not encrypted</list-item>
                                <list-item><id>aes-256-cbc</id> - Advanced Encryption Standard with 256 bit key length</list-item>
                            </list>

                            <p>Note that encryption is always performed client-side even if the repository type (e.g. S3) supports encryption.</p>
                        </text>

                        <default>none</default>
                        <example>aes-256-cbc</example>
                    </config-key>

                    <config-key id="repo-cipher-pass" name="Repository Cipher Passphrase">
                        <summary>Repository cipher passphrase.</summary>

                        <text>
                            <p>Passphrase used to encrypt/decrypt files of the repository.</p>
                        </text>

                        <example>zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="backup" name="Backup">
                <text>
                    <p>The <setting>backup</setting> section defines settings related to backup.</p>
                </text>

                <config-key-list>
                    <config-key id="annotation" name="Backup Annotation">
                        <summary>Annotate backup with user-defined key/value pairs.</summary>

                        <text>
                            <p>Users can attach informative key/value pairs to the backup. This option may be used multiple times to attach multiple annotations.</p>

                            <p>Annotations are output by the <cmd>info</cmd> command text output when a backup is specified with <br-option>--set</br-option> and always appear in the JSON output.</p>
                        </text>

                        <example>source="Sunday backup for website database"</example>
                    </config-key>

                    <config-key id="archive-check" name="Check Archive">
                        <summary>Check that WAL segments are in the archive before backup completes.</summary>

                        <text>
                            <p>Checks that all WAL segments required to make the backup consistent are present in the WAL archive. It's a good idea to leave this as the default unless you are using another method for archiving.</p>

                            <p>This option must be enabled if <br-option>archive-copy</br-option> is enabled.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="archive-copy" name="Copy Archive">
                        <summary>Copy WAL segments needed for consistency to the backup.</summary>

                        <text>
                            <p>This slightly paranoid option protects against corruption in the WAL segment archive by storing the WAL segments required for consistency directly in the backup. WAL segments are still stored in the archive so this option will use additional space.</p>

                            <p>It is best if the <cmd>archive-push</cmd> and <cmd>backup</cmd> commands have the same <setting>compress-type</setting> (e.g. <id>lz4</id>) when using this option. Otherwise, the WAL segments will need to be recompressed with the <setting>compress-type</setting> used by the backup, which can be fairly expensive depending on how much WAL was generated during the backup.</p>

                            <p>On restore, the WAL segments will be present in <path>pg_xlog/pg_wal</path> and <postgres/> will use them in preference to calling the <code>restore_command</code>.</p>

                            <p>The <br-option>archive-check</br-option> option must be enabled if <br-option>archive-copy</br-option> is enabled.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="archive-mode-check" name="Check Archive Mode">
                        <summary>Check the <postgres/> <setting>archive_mode</setting> setting.</summary>

                        <text>
                            <p>Enabled by default, this option disallows <postgres/> <setting>archive_mode=always</setting>.</p>

                            <p>WAL segments pushed from a standby server might be logically the same as WAL segments pushed from the primary but have different checksums. Disabling archiving from multiple sources is recommended to avoid conflicts.</p>

                            <admonition type="caution">If this option is disabled then it is critical to ensure that only one archiver is writing to the repository via the <cmd>archive-push</cmd> command.</admonition>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="backup-standby" name="Backup from Standby">
                        <summary>Backup from the standby cluster.</summary>

                        <text>
                            <p>Enable backup from standby to reduce load on the primary cluster. This option requires that both the <host>primary</host> and <host>standby</host> hosts be configured.</p>

                            <p>The following modes are supported:</p>

                            <list>
                                <list-item><id>y</id> - Standby is required for backup.</list-item>
                                <list-item><id>prefer</id> - Backup from standby if available otherwise backup from primary.</list-item>
                                <list-item><id>n</id> - Backup from primary only.</list-item>
                            </list>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="checksum-page" name="Page Checksums">
                        <summary>Validate data page checksums.</summary>

                        <text>
                            <p>Directs <backrest/> to validate all data page checksums while backing up a cluster. This option is automatically enabled when data page checksums are enabled on the cluster.</p>

                            <p>Failures in checksum validation will not abort a backup. Rather, warnings will be emitted in the log (and to the console with default settings) and the list of invalid pages will be stored in the backup manifest.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="exclude" name="Path/File Exclusions">
                        <summary>Exclude paths/files from the backup.</summary>

                        <text>
                            <p>All exclusions are relative to <path>$PGDATA</path>. If the exclusion ends with / then only files in the specified directory will be excluded, e.g. <br-option>--exclude=junk/</br-option> will exclude all files in the <path>$PGDATA/junk</path> directory but include the directory itself. If the exclusion does not end with / then the file may match the exclusion exactly or match with / appended to the exclusion, e.g. <br-option>--exclude=junk</br-option> will exclude the <path>$PGDATA/junk</path> directory and all the files it contains.</p>

                            <p><b>Be careful using this feature -- it is very easy to exclude something critical that will make the backup inconsistent. Be sure to test your restores!</b></p>

                            <p>All excluded files will be logged at <id>info</id> level along with the exclusion rule. Be sure to audit the list of excluded files to ensure nothing unexpected is being excluded.</p>

                            <admonition type="note">Exclusions are not honored on delta restores. Any files/directories that were excluded by the backup will be <i>removed</i> on delta restore.</admonition>

                            <p>This option should not be used to exclude <postgres/> logs from a backup. Logs can be moved out of the <id>PGDATA</id> directory using the <postgres/> <setting>log_directory</setting> setting, which has the benefit of allowing logs to be preserved after a restore.</p>

                            <p>Multiple exclusions may be specified on the command-line or in a configuration file.</p>
                        </text>

                        <example>junk/</example>
                    </config-key>

                    <config-key id="manifest-save-threshold" name="Manifest Save Threshold">
                        <summary>Manifest save threshold during backup.</summary>

                        <text>
                            <p>Defines how often the manifest will be saved during a backup. Saving the manifest is important because it stores the checksums and allows the resume function to work efficiently. The actual threshold used is 1% of the backup size or <setting>manifest-save-threshold</setting>, whichever is greater.</p>
                        </text>

                        <example>8GiB</example>
                    </config-key>

                    <config-key id="expire-auto" name="Expire Auto">
                        <summary>Automatically run the <cmd>expire</cmd> command after a successful backup.</summary>

                        <text>
                            <p>The setting is enabled by default. Use caution when disabling this option as doing so will result in retaining all backups and archives indefinitely, which could cause your repository to run out of space. The <cmd>expire</cmd> command will need to be run regularly to prevent this from happening.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="resume" name="Resume">
                        <summary>Allow resume of failed backup.</summary>

                        <text>
                            <p>Defines whether the resume feature is enabled. Resume can greatly reduce the amount of time required to run a backup after a previous backup of the same type has failed. It adds complexity, however, so it may be desirable to disable in environments that do not require the feature.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="start-fast" name="Start Fast">
                        <summary>Force a checkpoint to start backup quickly.</summary>

                        <text>
                            <p>Forces a checkpoint (by passing <id>y</id> to the <id>fast</id> parameter of the backup start function) so the backup begins immediately. Otherwise the backup will start after the next regular checkpoint.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="stop-auto" name="Stop Auto">
                        <summary>Stop prior failed backup on new backup.</summary>

                        <text>
                            <p>This will only be done if an exclusive advisory lock can be acquired to demonstrate that the prior failed backup process has really stopped.</p>

                            <p>This feature is not supported for <postgres/> >= <id>9.6</id> since backups are run in non-exclusive mode.</p>

                            <p>The setting is disabled by default because it assumes that <backrest/> is the only process doing exclusive online backups. It depends on an advisory lock that only <backrest/> sets so it may abort other processes that do exclusive online backups. Note that <cmd>base_backup</cmd> and <cmd>pg_dump</cmd> are safe to use with this setting because they do not call <code>pg_start_backup()</code> so are not exclusive.</p>
                        </text>

                        <example>y</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="archive" name="Archive">
                <text>
                    <p>The <setting>archive</setting> section defines options for the <cmd>archive-push</cmd> and <cmd>archive-get</cmd> commands.</p>
                </text>

                <config-key-list>
                    <config-key id="archive-async" name="Asynchronous Archiving">
                        <summary>Push/get WAL segments asynchronously.</summary>

                        <text>
                            <p>Enables asynchronous operation for the <cmd>archive-push</cmd> and <cmd>archive-get</cmd> commands.</p>

                            <p>Asynchronous operation is more efficient because it can reuse connections and take advantage of parallelism. See the <br-option>spool-path</br-option>, <br-option>archive-get-queue-max</br-option>, and <br-option>archive-push-queue-max</br-option> options for more information.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="archive-get-queue-max" name="Maximum Archive Get Queue Size">
                        <summary>Maximum size of the <backrest/> archive-get queue.</summary>

                        <text>
                            <p>Specifies the maximum size of the <cmd>archive-get</cmd> queue when <br-option>archive-async</br-option> is enabled. The queue is stored in the <br-option>spool-path</br-option> and is used to speed providing WAL to <postgres/>.</p>
                        </text>

                        <example>1GiB</example>
                    </config-key>

                    <config-key id="archive-missing-retry" name="Retry Missing WAL Segment">
                        <summary>Retry missing WAL segment</summary>

                        <text>
                            <p>Retry a WAL segment that was previously reported as missing by the <cmd>archive-get</cmd> command when in asynchronous mode. This prevents notifications in the spool path from a prior restore from being used and possibly causing a recovery failure if consistency has not been reached.</p>

                            <p>Disabling this option allows <postgres/> to more reliably recognize when the end of the WAL in the archive has been reached, which permits it to switch over to streaming from the primary. With retries enabled, a steady stream of WAL being archived will cause <postgres/> to continue getting WAL from the archive rather than switch to streaming.</p>

                            <p>When disabling this option it is important to ensure that the spool path for the stanza is empty. The <cmd>restore</cmd> command does this automatically if the spool path is configured at restore time. Otherwise, it is up to the user to ensure the spool path is empty.</p>
                        </text>

                        <example>n</example>
                    </config-key>

                    <config-key id="archive-push-queue-max" name="Maximum Archive Push Queue Size">
                        <summary>Maximum size of the <postgres/> archive queue.</summary>

                        <text>
                            <p>After the limit is reached, the following will happen:</p>

                            <list>
                                <list-item><backrest/> will notify <postgres/> that the WAL was successfully archived, then <b>DROP IT</b>.</list-item>
                                <list-item>A warning will be output to the <postgres/> log.</list-item>
                            </list>

                            <p>If this occurs then the archive log stream will be interrupted and PITR will not be possible past that point. A new backup will be required to regain full restore capability.</p>

                            <p>In asynchronous mode the entire queue will be dropped to prevent spurts of WAL getting through before the queue limit is exceeded again.</p>

                            <p>The purpose of this feature is to prevent the log volume from filling up at which point <postgres/> will stop completely. Better to lose the backup than have <postgres/> go down.</p>
                        </text>

                        <example>1TiB</example>
                    </config-key>

                    <config-key id="archive-timeout" name="Archive Timeout">
                        <summary>Archive timeout.</summary>

                        <text>
                            <p>Set maximum time, in seconds, to wait for each WAL segment to reach the <backrest/> archive repository. The timeout applies to the <cmd>check</cmd> and <cmd>backup</cmd> commands when waiting for WAL segments required for backup consistency to be archived.</p>
                        </text>

                        <example>30</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="restore" name="Restore">
                <text>
                    <p>The <setting>restore</setting> section defines settings used for restoring backups.</p>
                </text>

                <config-key-list>
                    <config-key id="archive-mode" name="Archive Mode">
                        <summary>Preserve or disable archiving on restored cluster.</summary>

                        <text>
                            <p>This option allows archiving to be preserved or disabled on a restored cluster. This is useful when the cluster must be promoted to do some work but is not intended to become the new primary. In this case it is not a good idea to push WAL from the cluster into the repository.</p>

                            <p>The following modes are supported:</p>

                            <list>
                                <list-item><id>off</id> - disable archiving by setting <setting>archive_mode=off</setting>.</list-item>
                                <list-item><id>preserve</id> - preserve current <setting>archive_mode</setting> setting.</list-item>
                            </list>

                            <p><b>NOTE</b>: This option is not available on <postgres/> &lt; 12.</p>
                        </text>

                        <example>off</example>
                    </config-key>

                    <config-key id="db-exclude" name="Exclude Database">
                        <summary>Restore excluding the specified databases.</summary>

                        <text>
                            <p>Databases excluded will be restored as sparse, zeroed files to save space but still allow <postgres/> to perform recovery. After recovery, those databases will not be accessible but can be removed with the <id>drop database</id> command. The <setting>{[dash]}-db-exclude</setting> option can be passed multiple times to specify more than one database to exclude.</p>

                            <p>When used in combination with the <setting>{[dash]}-db-include</setting> option, <setting>{[dash]}-db-exclude</setting> will only apply to standard system databases (<id>template0</id>, <id>template1</id>, and <id>postgres</id>).</p>
                        </text>

                        <example>db_main</example>
                    </config-key>

                    <config-key id="db-include" name="Include Database">
                        <summary>Restore only specified databases.</summary>

                        <text>
                            <p>This feature allows only selected databases to be restored. Databases not specifically included will be restored as sparse, zeroed files to save space but still allow <postgres/> to perform recovery. After recovery, the databases that were not included will not be accessible but can be removed with the <id>drop database</id> command.</p>

                            <admonition type="note">built-in databases (<id>template0</id>, <id>template1</id>, and <id>postgres</id>) are always restored unless specifically excluded.</admonition>

                            <p>The <setting>{[dash]}-db-include</setting> option can be passed multiple times to specify more than one database to include.</p>

                            <p>See <link page="user-guide" section="/restore/option-db-include">Restore Selected Databases</link> for additional information and caveats.</p>
                        </text>

                        <example>db_main</example>
                    </config-key>

                    <config-key id="link-all" name="Link All">
                        <summary>Restore all symlinks.</summary>

                        <text>
                            <p>By default symlinked directories and files are restored as normal directories and files in $PGDATA. This is because it may not be safe to restore symlinks to their original destinations on a system other than where the original backup was performed. This option restores all the symlinks just as they were on the original system where the backup was performed.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="link-map" name="Link Map">
                        <summary>Modify the destination of a symlink.</summary>

                        <text>
                            <p>Allows the destination file or path of a symlink to be changed on restore. This is useful for restoring to systems that have a different storage layout than the original system where the backup was generated.</p>
                        </text>

                        <example>pg_xlog=/data/xlog</example>
                    </config-key>

                    <config-key id="recovery-option" name="Recovery Option">
                        <summary>Set an option in <file>postgresql.auto.conf</file> or <file>recovery.conf</file>.</summary>

                        <text>
                            <p>See <link url="https://www.postgresql.org/docs/current/runtime-config.html">Server Configuration</link> for details on <file>postgresql.auto.conf</file> or <file>recovery.conf</file> options (be sure to select your <postgres/> version). This option can be used multiple times.</p>

                            <p>For <postgres/> &gt;= 12, options will be written into <file>postgresql.auto.conf</file>. For all other versions, options will be written into <file>recovery.conf</file>.</p>

                            <admonition type="note">The <setting>restore_command</setting> option will be automatically generated but can be overridden with this option. Be careful about specifying your own <setting>restore_command</setting> as <backrest/> is designed to handle this for you. Target Recovery options (recovery_target_name, recovery_target_time, etc.) are generated automatically by <backrest/> and should not be set with this option.</admonition>

                            <p>Since <backrest/> does not start <postgres/> after writing the <file>postgresql.auto.conf</file> or <file>recovery.conf</file> file, it is always possible to edit/check <file>postgresql.auto.conf</file> or <file>recovery.conf</file> before manually restarting.</p>
                        </text>

                        <example>primary_conninfo=db.mydomain.com</example>
                    </config-key>

                    <config-key id="tablespace-map" name="Tablespace Map">
                        <summary>Restore a tablespace into the specified directory.</summary>

                        <text>
                            <p>Moves a tablespace to a new location during the restore. This is useful when tablespace locations are not the same on a replica, or an upgraded system has different mount points.</p>

                            <p>Tablespace locations are not stored in pg_tablespace so moving tablespaces can be done with impunity. However, moving a tablespace to the <setting>data_directory</setting> is not recommended and may cause problems. For more information on moving tablespaces http://www.databasesoup.com/2013/11/moving-tablespaces.html is a good resource.</p>
                        </text>

                        <example>ts_01=/db/ts_01</example>
                    </config-key>

                    <config-key id="tablespace-map-all" name="Map All Tablespaces">
                        <summary>Restore all tablespaces into the specified directory.</summary>

                        <text>
                            <p>Tablespaces are restored into their original locations by default. This behavior can be modified for each tablespace with the <setting>tablespace-map</setting> option, but it is sometimes preferable to remap all tablespaces to a new directory all at once. This is particularly useful for development or staging systems that may not have the same storage layout as the original system where the backup was generated.</p>

                            <p>The path specified will be the parent path used to create all the tablespaces in the backup.</p>

                            <admonition type="caution">Tablespaces created after the backup started will not be mapped. Make a new backup after a tablespace is created if tablespace mapping is required.</admonition>
                        </text>

                        <example>/data/tablespace</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="server" name="Server">
                <text>
                    <p>The <setting>server</setting> section defines options used for configuring the <proper>TLS</proper> server.</p>
                </text>

                <config-key-list>
                    <config-key id="tls-server-auth" name="TLS Server Authorized Clients">
                        <summary>TLS server authorized clients.</summary>

                        <text>
                            <p>Clients are authorized on the server by verifying their certificate and checking their certificate CN (Common Name) against a list on the server configured with the <br-option>tls-server-auth</br-option> option.</p>

                            <p>A client CN can be authorized for as many stanzas as needed by providing a comma-separated list to the <br-option>tls-server-auth</br-option> option or for all stanzas by specifying <br-option>tls-server-auth=client-cn=*</br-option>. Wildcards may not be specified for the client CN.</p>
                        </text>

                        <example>client-cn=stanza1,stanza2</example>
                    </config-key>

                    <config-key id="tls-server-ca-file" name="TLS Server Certificate Authorities">
                        <summary>TLS server certificate authorities.</summary>

                        <text>
                            <p>Checks that client certificates are signed by a trusted certificate authority.</p>
                        </text>

                        <example>/path/to/server.ca</example>
                    </config-key>

                    <config-key id="tls-server-cert-file" name="TLS Server Certificate">
                        <summary>TLS server certificate file.</summary>

                        <text>
                            <p>Sent to the client to show the server identity.</p>
                        </text>

                        <example>/path/to/server.crt</example>
                    </config-key>

                    <config-key id="tls-server-key-file" name="TLS Server Key">
                        <summary>TLS server key file.</summary>

                        <text>
                            <p>Proves server certificate was sent by the owner.</p>
                        </text>

                        <example>/path/to/server.key</example>
                    </config-key>

                    <config-key id="tls-server-address" name="TLS Server Address">
                        <summary>TLS server address.</summary>

                        <text>
                            <p>IP address the server will listen on for client requests.</p>
                        </text>

                        <example>*</example>
                    </config-key>

                    <config-key id="tls-server-port" name="TLS Server Port">
                        <summary>TLS server port.</summary>

                        <text>
                            <p>Port the server will listen on for client requests.</p>
                        </text>

                        <example>8000</example>
                    </config-key>
                </config-key-list>
            </config-section>

            <config-section id="stanza" name="Stanza">
                <text>
                    <p>A stanza defines the backup configuration for a specific <postgres/> database cluster. The stanza section must define the database cluster path and host/user if the database cluster is remote. Also, any global configuration sections can be overridden to define stanza-specific settings.</p>

                    <p><b>Indexing</b>: All <setting>pg-</setting> options are indexed to allow for configuring multiple <postgres/> hosts. For example, a single primary is configured with the <setting>pg1-path</setting>, <setting>pg1-port</setting>, etc. options. If a standby is configured then index the <setting>pg-</setting> options on the repository host as <setting>pg2-</setting> (e.g. pg2-host, pg2-path, etc).</p>
                </text>

                <config-key-list>
                    <config-key id="pg-host-cmd" name="PostgreSQL Host Command">
                        <summary><postgres/> host <backrest/> command.</summary>

                        <text>
                            <p>Required only if the path to the <backrest/> command is different on the local and <postgres/> hosts. If not defined, the <postgres/> host command will be set the same as the local command.</p>
                        </text>

                        <example>/usr/lib/backrest/bin/pgbackrest</example>
                    </config-key>

                    <config-key id="pg-host-config" name="PostgreSQL Host Configuration">
                        <summary><backrest/> database host configuration file.</summary>

                        <text>
                            <p>Sets the location of the configuration file on the <postgres/> host. This is only required if the <postgres/> host configuration file is in a different location than the local configuration file.</p>
                        </text>

                        <example>/conf/pgbackrest/pgbackrest.conf</example>
                    </config-key>

                    <config-key id="pg-host-config-include-path" name="PostgreSQL Host Configuration Include Path">
                        <summary><backrest/> database host configuration include path.</summary>

                        <text>
                            <p>Sets the location of the configuration include path on the <postgres/> host. This is only required if the <postgres/> host configuration include path is in a different location than the local configuration include path.</p>
                        </text>

                        <example>/conf/pgbackrest/conf.d</example>
                    </config-key>

                    <config-key id="pg-host-config-path" name="PostgreSQL Host Configuration Path">
                        <summary><backrest/> database host configuration path.</summary>

                        <text>
                            <p>Sets the location of the configuration path on the <postgres/> host. This is only required if the <postgres/> host configuration path is in a different location than the local configuration path.</p>
                        </text>

                        <example>/conf/pgbackrest</example>
                    </config-key>

                    <config-key id="pg-host" name="PostgreSQL Host">
                        <summary><postgres/> host for operating remotely.</summary>

                        <text>
                            <p>Used for backups where the <postgres/> host is different from the repository host.</p>
                        </text>

                        <example>db.domain.com</example>
                    </config-key>

                    <config-key id="pg-host-ca-file" name="PostgreSQL Host Certificate Authority File">
                        <summary><postgres/> host certificate authority file.</summary>

                        <text>
                            <p>Use a CA file other than the system default for connecting to the <postgres/> host.</p>
                        </text>

                        <example>/etc/pki/tls/certs/ca-bundle.crt</example>
                    </config-key>

                    <config-key id="pg-host-ca-path" name="PostgreSQL Host Certificate Authority Path">
                        <summary><postgres/> host certificate authority path.</summary>

                        <text>
                            <p>Use a CA path other than the system default for connecting to the <postgres/> host.</p>
                        </text>

                        <example>/etc/pki/tls/certs</example>
                    </config-key>

                    <config-key id="pg-host-cert-file" name="PostgreSQL Host Certificate File">
                        <summary><postgres/> host certificate file.</summary>

                        <text>
                            <p>Sent to <postgres/> host to prove client identity.</p>
                        </text>

                        <example>/path/to/client.crt</example>
                    </config-key>

                    <config-key id="pg-host-key-file" name="PostgreSQL Host Key File">
                        <summary><postgres/> host key file.</summary>

                        <text>
                            <p>Proves client certificate was sent by owner.</p>
                        </text>

                        <example>/path/to/client.key</example>
                    </config-key>

                    <config-key id="pg-host-type" name="PostgreSQL Host Protocol Type">
                        <summary><postgres/> host protocol type.</summary>

                        <text>
                            <p>The following protocol types are supported:</p>

                            <list>
                                <list-item><id>ssh</id> - Secure Shell.</list-item>
                                <list-item><id>tls</id> - <backrest/> TLS server.</list-item>
                            </list>
                        </text>

                        <example>tls</example>
                    </config-key>

                    <config-key id="pg-host-user" name="PostgreSQL Host User">
                        <summary><postgres/> host logon user when <setting>pg-host</setting> is set.</summary>

                        <text>
                            <p>This user will also own the remote <backrest/> process and will initiate connections to <postgres/>. For this to work correctly the user should be the <postgres/> database cluster owner which is generally <id>postgres</id>, the default.</p>
                        </text>

                        <example>db_owner</example>
                    </config-key>

                    <config-key id="pg-database" name="PostgreSQL Database">
                        <summary><postgres/> database.</summary>

                        <text>
                            <p>The database name used when connecting to <postgres/>. The default is usually best but some installations may not contain this database.</p>

                            <p>Note that for legacy reasons the setting of the <id>PGDATABASE</id> environment variable will be ignored.</p>
                        </text>

                        <example>backupdb</example>
                    </config-key>

                    <config-key id="pg-local" name="PostgreSQL Locality">
                        <summary><postgres/> is local.</summary>

                        <text>
                            <p>Indicates that <postgres/> for the specified index is local and any <postgres/> host settings for that index (e.g. <setting>pg1-host</setting>) should be ignored.</p>
                        </text>

                        <example>y</example>
                    </config-key>

                    <config-key id="pg-path" name="PostgreSQL Path">
                        <summary><postgres/> data directory.</summary>

                        <text>
                            <p>This should be the same as the <setting>data_directory</setting> reported by <postgres/>. Even though this value can be read from various places, it is prudent to set it in case those resources are not available during a restore or offline backup scenario.</p>

                            <p>The <setting>pg-path</setting> option is tested against the value reported by <postgres/> on every online backup so it should always be current.</p>
                        </text>

                        <example>/data/db</example>
                    </config-key>

                    <config-key id="pg-port" name="PostgreSQL Port">
                        <summary><postgres/> port.</summary>

                        <text>
                            <p>Port that <postgres/> is running on. This usually does not need to be specified as most <postgres/> clusters run on the default port.</p>
                        </text>

                        <example>6543</example>
                    </config-key>

                    <config-key id="pg-socket-path" name="PostgreSQL Socket Path">
                        <summary><postgres/> unix socket path.</summary>

                        <text>
                            <p>The unix socket directory that was specified when <postgres/> was started. <backrest/> will automatically look in the standard location for your OS so there is usually no need to specify this setting unless the socket directory was explicitly modified with the <setting>unix_socket_directories</setting> setting in <file>postgresql.conf</file>.</p>
                        </text>

                        <example>/var/run/postgresql</example>
                    </config-key>

                    <config-key id="pg-user" name="PostgreSQL Database User">
                        <summary><postgres/> database user.</summary>

                        <text>
                            <p>The database user name used when connecting to <postgres/>. If not specified <backrest/> will connect with the local OS user or <id>PGUSER</id>.</p>
                        </text>

                        <example>backupuser</example>
                    </config-key>

                    <config-key id="pg-host-port" name="PostgreSQL Host Port">
                        <summary><postgres/> host port when <setting>pg-host</setting> is set.</summary>

                        <text>
                            <p>Use this option to specify a non-default port for the <postgres/> host protocol.</p>

                            <admonition type="note">When <setting>pg-host-type=ssh</setting> there is no default for <setting>pg-host-port</setting>. In this case the port will be whatever is configured for the command specified by <setting>cmd-ssh</setting>.</admonition>
                        </text>

                        <example>25</example>
                    </config-key>
                </config-key-list>
            </config-section>
        </config-section-list>
    </config>

    <operation title="Command Reference">
        <description>The {[project]} Command Reference details all commands and options.</description>

        <text>
            <p>Commands are used to execute the various <backrest/> functions. Here the command options are listed exhaustively, that is, each option applicable to a command is listed with that command even if it applies to one or more other commands. This includes all the options that may also be configured in <file>pgbackrest.conf</file>.</p>

            <p>Non-boolean options configured in <file>pgbackrest.conf</file> can be reset to default on the command-line by using the <id>reset-</id> prefix. This feature may be used to restore a backup directly on a repository host. Normally, <backrest/> will error because it can see that the database host is remote and restores cannot be done remotely. By adding <br-option>--reset-pg1-host</br-option> on the command-line, <backrest/> will ignore the remote database host and restore locally. It may be necessary to pass a new <br-option>--pg1-path</br-option> to force the restore to happen in a specific path, i.e. not the path used on the database host.</p>

            <p>The <id>no-</id> prefix may be used to set a boolean option to false on the command-line.</p>

            <p>Any option may be set in an environment variable using the <id>PGBACKREST_</id> prefix and the option name in all caps replacing <id>-</id> with <id>_</id>, e.g. <br-option>pg1-path</br-option> becomes <id>PGBACKREST_PG1_PATH</id> and <br-option>stanza</br-option> becomes <id>PGBACKREST_STANZA</id>. Boolean options are represented as they would be in a configuration file, e.g. <id>PGBACKREST_COMPRESS="n"</id>, and <id>reset-*</id> variants are not allowed. Options that can be specified multiple times on the command-line or in a config file can be represented by separating the values with colons, e.g. <id>PGBACKREST_DB_INCLUDE="db1:db2"</id>.</p>

            <p>Command-line options override environment options which override config file options.</p>

            <p>See <link page="configuration" section="/introduction">Configuration Introduction</link> for information on option types</p>
        </text>

        <operation-general title="General Options">
            <option-list>
                <option id="cipher-pass" name="Ad Hoc Cipher Passphrase">
                    <summary>Cipher passphrase for current command.</summary>

                    <text>
                        <p>Specify an ad hoc cipher passphrase for the current command.</p>
                    </text>

                    <example>zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO</example>
                </option>

                <option id="config" name="Config">
                    <summary><backrest/> configuration file.</summary>

                    <text>
                        <p>Use this option to specify a different configuration file than the default.</p>
                    </text>

                    <example>/conf/pgbackrest/pgbackrest.conf</example>
                </option>

                <option id="config-include-path" name="Config Include Path">
                    <summary>Path to additional <backrest/> configuration files.</summary>

                    <text>
                        <p>Configuration files existing in the specified location with extension <file>.conf</file> will be concatenated with the <backrest/> configuration file, resulting in one configuration file.</p>
                    </text>

                    <example>/conf/pgbackrest/conf.d</example>
                </option>

                <option id="config-path" name="Config Path">
                    <summary>Base path of <backrest/> configuration files.</summary>

                    <text>
                        <p>This setting is used to override the default base path setting for the <br-option>--config</br-option> and <br-option>--config-include-path</br-option> options unless they are explicitly set on the command-line.</p>

                        <p>For example, passing only <code>--config-path=/conf/pgbackrest</code> results in the <br-option>--config</br-option> default being set to <code>/conf/pgbackrest/pgbackrest.conf</code> and the <br-option>--config-include-path</br-option> default being set to <code>/conf/pgbackrest/conf.d</code>.</p>
                    </text>

                    <example>/conf/pgbackrest</example>
                </option>

                <option id="dry-run" name="Dry Run">
                    <summary>Execute a dry-run for the command.</summary>

                    <text>
                        <p>The <br-option>{[dash]}-dry-run</br-option> option is a command-line only option and can be passed when it is desirable to determine what modifications will be made by the command without the command actually making any modifications.</p>
                    </text>

                    <example>y</example>
                </option>

                <option id="exec-id" name="Execution Identifier">
                    <summary>Unique identifier for the process.</summary>

                    <text>
                        <p>A locally unique identifier used to identify a process when resolving locks on a remote host.</p>

                        <p>The <setting>exec-id</setting> option is generated automatically when needed but it is possible to set it explicitly, which saves a bit of time at startup but introduces the problem of selecting a unique value.</p>
                    </text>

                    <example>y</example>
                </option>

                <option id="raw" name="Raw Data">
                    <summary>Do not transform data.</summary>

                    <text>
                        <p>Do not transform (i.e, encrypt, decompress, etc.) data for the current command.</p>
                    </text>

                    <example>y</example>
                </option>

                <option id="repo" section="repository" name="Set Repository">
                    <summary>Set repository.</summary>

                    <text>
                        <p>Set the repository for a command to operate on.</p>

                        <p>For example, this option may be used to perform a restore from a specific repository, rather than letting <backrest/> choose.</p>
                    </text>

                    <example>1</example>
                </option>

                <option id="stanza" name="Stanza">
                    <summary>Defines the stanza.</summary>

                    <text>
                        <p>A stanza is the configuration for a <postgres/> database cluster that defines where it is located, how it will be backed up, archiving options, etc. Most db servers will only have one <postgres/> database cluster and therefore one stanza, whereas backup servers will have a stanza for every database cluster that needs to be backed up.</p>

                        <p>It is tempting to name the stanza after the primary cluster but a better name describes the databases contained in the cluster. Because the stanza name will be used for the primary and all replicas it is more appropriate to choose a name that describes the actual function of the cluster, such as app or dw, rather than the local cluster name, such as main or prod.</p>
                    </text>

                    <example>main</example>
                </option>
            </option-list>
        </operation-general>

        <command-list title="Commands">
            <command id="annotate" name="Annotate">
                <summary>Add or modify backup annotation.</summary>

                <text>
                    <p>Annotations included with the <cmd>backup</cmd> command can be added, modified, or removed afterwards using the <cmd>annotate</cmd> command.</p>
                </text>

                <option-list>
                    <option id="set" name="Set">
                        <summary>Backup set to annotate.</summary>

                        <text>
                            <p>The backup set to annotate.</p>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>
                </option-list>
            </command>

            <command id="backup" name="Backup">
                <summary>Backup a database cluster.</summary>

                <text>
                    <p>When multiple repositories are configured, <backrest/> will backup to the highest priority repository (e.g. <id>repo1</id>) unless the <br-option>{[dash]}-repo</br-option> option is specified.</p>

                    <p><backrest/> does not have a built-in scheduler so it's best to run it from cron or some other scheduling mechanism.</p>

                    <p>See <link page="user-guide" section="/quickstart/perform-backup">Perform a Backup</link> for more details and examples.</p>
                </text>

                <option-list>
                    <option id="type" name="Type">
                        <summary>Backup type.</summary>

                        <text>
                            <p>The following backup types are supported:</p>

                            <list>
                                <list-item><id>full</id> - all database cluster files will be copied and there will be no dependencies on previous backups.</list-item>
                                <list-item><id>incr</id> - incremental from the last successful backup.</list-item>
                                <list-item><id>diff</id> - like an incremental backup but always based on the last full backup.</list-item>
                            </list>
                        </text>

                        <example>full</example>
                    </option>

                    <option id="force" name="Force">
                        <summary>Force an offline backup.</summary>

                        <text>
                            <p>When used with <br-option>--no-start-stop</br-option> a backup will be run even if <backrest/> thinks that <postgres/> is running. <b>This option should be used with extreme care as it will likely result in a bad backup.</b></p>

                            <p>There are some scenarios where a backup might still be desirable under these conditions. For example, if a server crashes and the database cluster volume can only be mounted read-only, it would be a good idea to take a backup even if <file>postma&#115;ter.pid</file> is present. In this case it would be better to revert to the prior backup and replay WAL, but possibly there is a very important transaction in a WAL segment that did not get archived.</p>
                        </text>

                        <example>y</example>
                    </option>

                    <option id="online" name="Online">
                        <summary>Perform an online backup.</summary>

                        <text>
                            <p>Specifying --no-online prevents <backrest/> from running the backup start/stop functions on the database cluster. In order for this to work <postgres/> should be shut down and <backrest/> will generate an error if it is not.</p>

                            <p>The purpose of this option is to allow offline backups. The <path>pg_xlog</path>/<path>pg_wal</path> directory is copied as-is and <setting>archive-check</setting> is automatically disabled for the backup.</p>
                        </text>

                        <example>n</example>
                    </option>
                </option-list>
            </command>

            <command id="archive-push" name="Archive Push">
                <summary>Push a WAL segment to the archive.</summary>

                <text>
                    <p>Accepts a WAL segment from <postgres/> and archives it in each repository defined by the indexed <setting>repo-path</setting> option (see the <link page="configuration" section="/section-repository">Repository</link> section for information on configuring repositories). The WAL segment may be pushed immediately to the archive or stored locally depending on the value of <setting>archive-async</setting>. With multiple repositories configured, <cmd>archive-push</cmd> will attempt to push to as many repositories as possible.</p>

                    <p>The <cmd>archive-push</cmd> is intended to be configured and called by <postgres/>. See <link page="user-guide" section="/quickstart/configure-archiving">Configure Archiving</link> for an example.</p>
                </text>
            </command>

            <command id="archive-get" name="Archive Get">
                <summary>Get a WAL segment from the archive.</summary>

                <text>
                    <p>This command is used by <postgres/> to restore a backup, perform PITR, or as an alternative to streaming for keeping a replica up to date. WAL segments are required for <postgres/> recovery or to maintain a replica.</p>

                    <p>When multiple repositories are configured, WAL will be fetched from the repositories in priority order (e.g. <id>repo1</id>, <id>repo2</id>, etc.). In general it is better if faster/cheaper storage has higher priority. If a repository is specified with the <br-option>{[dash]}-repo</br-option> option then only that repository will be searched.</p>

                    <p>The <cmd>archive-get</cmd> command is configured and generated by <backrest/> during a restore for use by <postgres/>. See <link page="user-guide" section="/pitr">Point-in-Time Recovery</link> for an example.</p>
                </text>
            </command>

            <command id="check" name="Check">
                <summary>Check the configuration.</summary>

                <text>
                    <p>The <cmd>check</cmd> command validates that <backrest/> and the <pg-setting>archive_command</pg-setting> setting are configured correctly for archiving and backups for the specified stanza. It will attempt to check all repositories and databases that are configured for the host on which the command is run. It detects misconfigurations, particularly in archiving, that result in incomplete backups because required WAL segments did not reach the archive. The command can be run on the <postgres/> or repository host. The command may also be run on the standby host, however, since <code>pg_switch_xlog()</code>/<code>pg_switch_wal()</code> cannot be performed on the standby, the command will only test the repository configuration.</p>

                    <p>Note that <code>pg_create_restore_point('pgBackRest Archive Check')</code> and <code>pg_switch_xlog()</code>/<code>pg_switch_wal()</code> are called to force <postgres/> to archive a WAL segment.</p>

                    <!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
                </text>

                <option-list>
                    <option id="report" name="Report">
                        <summary>Generate a check report.</summary>

                        <text>
                            <p>Generate a report based on the results of the check command.</p>
                        </text>

                        <example>y</example>
                    </option>
                </option-list>
            </command>

            <command id="expire" name="Expire">
                <summary>Expire backups that exceed retention.</summary>

                <text>
                    <p><backrest/> does full backup rotation based on the retention type which can be a count or a time period. When a count is specified, then expiration is not concerned with when the backups were created but with how many must be retained. Differential backups are count-based but will always be expired when the full backup they depend on is expired. Incremental backups are not expired by retention independently &amp;mdash; they are always expired with their related full or differential backup. See sections <link page="user-guide" section="/retention/full">Full Backup Retention</link> and <link page="user-guide" section="/retention/diff">Differential Backup Retention</link> for details and examples.</p>

                    <p>Archived WAL is retained by default for backups that have not expired, however, although not recommended, this schedule can be modified per repository with the retention-archive options. See section <link page="user-guide" section="/retention/archive">Archive Retention</link> for details and examples.</p>

                    <p>The <cmd>expire</cmd> command is run automatically after each successful backup and can also be run by the user. When run by the user, expiration will occur as defined by the retention settings for each configured repository. If the <br-option>{[dash]}-repo</br-option> option is provided, expiration will occur only on the specified repository. Expiration can also be limited by the user to a specific backup set with the <br-option>--set</br-option> option and, unless the <br-option>{[dash]}-repo</br-option> option is specified, all repositories will be searched and any matching the set criteria will be expired. It should be noted that the archive retention schedule will be checked and performed any time the <cmd>expire</cmd> command is run.</p>
                </text>

                <option-list>
                    <option id="set" name="Set">
                        <summary>Backup set to expire.</summary>

                        <text>
                            <p>The specified backup set (i.e. the backup label provided and all of its dependent backups, if any) will be expired regardless of backup retention rules except that at least one full backup must remain in the repository.</p>

                            <admonition type="warning">Use this option with extreme caution &amp;mdash; it will permanently remove all backups and archives not required to make a backup consistent from the <backrest/> repository for the specified backup set. This process may negate the ability to perform PITR. If <br-option>--repo-retention-full</br-option> and/or <br-option>--repo-retention-archive</br-option> options are configured, then it is recommended that you override these options by setting their values to the maximum while performing ad hoc expiration in order to prevent an unintended expiration of archives.</admonition>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>
                </option-list>
            </command>

            <command id="manifest" name="Query Manifest">
                <summary>Query manifest.</summary>

                <text>
                    <p>Get information from a manifest including the restore strategy.</p>
                </text>

                <option-list>
                    <option id="filter" name="Filter Output">
                        <summary>Filter files in output.</summary>

                        <text>
                            <p>The filter currently only applies to files and must be specified relative to <id>PGDATA</id>.</p>
                        </text>

                        <example>base/13398/16397</example>
                    </option>

                    <option id="output" name="Output">
                        <summary>Output format.</summary>

                        <text>
                            <p>The following output types are supported:</p>

                            <list>
                                <list-item><id>text</id> - Human-readable summary of manifest information.</list-item>
                                <list-item><id>json</id> - Exhaustive machine-readable manifest information in JSON format.</list-item>
                            </list>
                        </text>

                        <example>json</example>
                    </option>

                    <option id="pg" name="PostgreSQL Cluster">
                        <summary>PostgreSQL Cluster</summary>

                        <text>
                            <p>Specify the PostgreSQL cluster to compare the manifest against.</p>
                        </text>

                        <example>1</example>
                    </option>

                    <option id="reference" name="Filter on Reference">
                        <summary>Filter on reference.</summary>

                        <text>
                            <p>Show only files with the specified reference. Use <id>latest</id> for files that were updated in the backup specified by <br-option>--set</br-option>.</p>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>

                    <option id="set" name="Set">
                        <summary>Manifest to query.</summary>

                        <text>
                            <p>When not specified the latest manifest will be queried.</p>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>
                </option-list>
            </command>

            <command id="repo-get" name="Repository Get">
                <summary>Get a file from a repository.</summary>

                <text>
                    <p>Similar to the unix <cmd>cat</cmd> command but works on any supported repository type. This command requires a fully qualified file name and is primarily for administration, investigation, and testing. It is not a required part of a normal <backrest/> setup.</p>

                    <p>If the repository is encrypted then <cmd>repo-get</cmd> will automatically decrypt the file. Files are not automatically decompressed but the output can be piped through the appropriate decompression command, e.g. <id>gzip -d</id>.</p>

                    <p>If more than one repository is configured, the command will default to the highest priority repository (e.g. <id>repo1</id>) unless the <br-option>{[dash]}-repo</br-option> option is specified.</p>
                </text>

                <option-list>
                    <option id="ignore-missing" name="Ignore Missing">
                        <summary>Ignore missing source file.</summary>

                        <text>
                            <p>Exit with 1 if the source file is missing but don't throw an error.</p>
                        </text>

                        <example>y</example>
                    </option>
                </option-list>
            </command>

            <command id="repo-ls" name="Repository List">
                <summary>List files in a repository.</summary>

                <text>
                    <p>Similar to the unix <cmd>ls</cmd> command but works on any supported repository type. This command accepts a path, absolute or relative to the repository path defined by the <br-option>{[dash]}-repo-path</br-option> option, and is primarily for administration, investigation, and testing. It is not a required part of a normal <backrest/> setup.</p>

                    <p>The default text output prints one file name per line. JSON output is available by specifying <br-option>--output=json</br-option>.</p>

                    <p>If more than one repository is configured, the command will default to the highest priority repository (e.g. <id>repo1</id>) unless the <br-option>{[dash]}-repo</br-option> option is specified.</p>
                </text>

                <option-list>
                    <option id="filter" name="Filter Output">
                        <summary>Filter output with a regular expression.</summary>

                        <text>
                            <p>The filter is applied against the file/path names before they are output.</p>
                        </text>

                        <example>"(F|D|I)$"</example>
                    </option>

                    <option id="output" name="Output">
                        <summary>Output format.</summary>

                        <text>
                            <p>The following output types are supported:</p>

                            <list>
                                <list-item><id>text</id> - Simple list with one file/link/path name on each line.</list-item>
                                <list-item><id>json</id> - Detailed file/link/path information in JSON format.</list-item>
                            </list>

                            <p>In JSON format the available fields are:</p>

                            <list>
                                <list-item><id>name</id> - file/link/path name (and partial path when recursing).</list-item>
                                <list-item><id>type</id> - <id>file</id>, <id>path</id>, or <id>link</id>.</list-item>
                                <list-item><id>size</id> - size in bytes (files only).</list-item>
                                <list-item><id>time</id> - time last modified (files only).</list-item>
                                <list-item><id>destination</id> - link destination (links only).</list-item>
                            </list>
                        </text>

                        <example>json</example>
                    </option>

                    <option id="recurse" name="Recurse Subpaths">
                        <summary>Include all subpaths in output.</summary>

                        <text>
                            <p>All subpaths and their files will be included in the output.</p>
                        </text>

                        <example>y</example>
                    </option>

                    <option id="sort" name="Sort Output">
                        <summary>Sort output ascending, descending, or none.</summary>

                        <text>
                            <p>The following sort types are supported:</p>

                            <list>
                                <list-item><id>asc</id> - sort ascending.</list-item>
                                <list-item><id>desc</id> - sort descending.</list-item>
                                <list-item><id>none</id> - no sorting.</list-item>
                            </list>
                        </text>

                        <example>desc</example>
                    </option>
                </option-list>
            </command>

            <command id="repo-put" name="Repository Put File">
                <summary>Put a file in the repository.</summary>

                <text>
                    <p>Similar to the unix <cmd>tee</cmd> command by copying from stdin to a file but options and behavior are different. This command requires a fully qualified file name and is primarily for administration, investigation, and testing. It is not a required part of a normal <backrest/> setup.</p>

                    <p>If more than one repository is configured, the command will default to the highest priority repository (e.g. <id>repo1</id>) unless the <br-option>{[dash]}-repo</br-option> option is specified.</p>
                </text>
            </command>

            <command id="repo-rm" name="Repository Remove Paths/Files">
                <summary>Remove paths/files in the repository.</summary>

                <text>
                    <p>Similar to the unix <cmd>rm</cmd> command but options are different. This command accepts a path, absolute or relative to the repository path defined by the <br-option>{[dash]}-repo-path</br-option> option, and is primarily for administration, investigation, and testing. It is not a required part of a normal <backrest/> setup.</p>

                    <p>If more than one repository is configured, the command will default to the highest priority repository (e.g. <id>repo1</id>) unless the <br-option>{[dash]}-repo</br-option> option is specified.</p>
                </text>

                <option-list>
                    <option id="recurse" name="Recurse Subpaths">
                        <summary>Remove all sub file/paths.</summary>

                        <text>
                            <p>All subpaths and their files will be removed.</p>
                        </text>

                        <example>y</example>
                    </option>
                </option-list>
            </command>

            <command id="restore" name="Restore">
                <summary>Restore a database cluster.</summary>

                <text>
                    <p>The restore command automatically defaults to selecting the latest backup from the first repository where backups exist (see <link page="user-guide" section="/quickstart/perform-restore">Quick Start - Restore a Backup</link>). The order in which the repositories are checked is dictated by the <file>pgbackrest.conf</file> (e.g. repo1 will be checked before repo2). To select from a specific repository, the <br-option>{[dash]}-repo</br-option> option can be passed (e.g. <br-option>{[dash]}-repo=1</br-option>). The <br-option>{[dash]}-set</br-option> option can be passed if a backup other than the latest is desired.</p>

                    <p>When PITR of <br-option>{[dash]}-type=time</br-option> or <br-option>{[dash]}-type=lsn</br-option> is specified, then the target time or target lsn must be specified with the <br-option>{[dash]}-target</br-option> option. If a backup is not specified via the <br-option>{[dash]}-set</br-option> option, then the configured repositories will be checked, in order, for a backup that contains the requested time or lsn. If no matching backup is found, the latest backup from the first repository containing backups will be used for <br-option>{[dash]}-type=time</br-option> while no backup will be selected for <br-option>{[dash]}-type=lsn</br-option>. For other types of PITR, e.g. <id>xid</id>, the <br-option>{[dash]}-set</br-option> option must be provided if the target is prior to the latest backup. See <link page="user-guide" section="/pitr">Point-in-Time Recovery</link> for more details and examples.</p>

                    <p>Replication slots are not included per recommendation of <postgres/>. See <link url="https://www.postgresql.org/docs/current/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP-DATA">Backing Up The Data Directory</link> in the <postgres/> documentation for more information.</p>
                </text>

                <option-list>
                    <option id="set" name="Set">
                        <summary>Backup set to restore.</summary>

                        <text>
                            <p>The backup set to be restored. <id>latest</id> will restore the latest backup, otherwise provide the name of the backup to restore.</p>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>

                    <option id="force" name="Force">
                        <summary>Force a restore.</summary>

                        <text>
                            <p>By itself this option forces the <postgres/> data and tablespace paths to be completely overwritten. In combination with <br-option>--delta</br-option> a timestamp/size delta will be performed instead of using checksums.</p>
                        </text>

                        <example>y</example>
                    </option>

                    <option id="type" name="Type">
                        <summary>Recovery type.</summary>

                        <text>
                            <p>The following recovery types are supported:</p>

                            <list>
                                <list-item><id>default</id> - recover to the end of the archive stream.</list-item>
                                <list-item><id>immediate</id> - recover only until the database becomes consistent.</list-item>
                                <list-item><id>lsn</id> - recover to the LSN (Log Sequence Number) specified in <br-option>--target</br-option>. This option is only supported on <postgres/> &gt;= 10.</list-item>
                                <list-item><id>name</id> - recover the restore point specified in <br-option>--target</br-option>.</list-item>
                                <list-item><id>xid</id> - recover to the transaction id specified in <br-option>--target</br-option>.</list-item>
                                <list-item><id>time</id> - recover to the time specified in <br-option>--target</br-option>.</list-item>
                                <list-item><id>preserve</id> - preserve the existing <file>postgresql.auto.conf</file> or <file>recovery.conf</file> file.</list-item>
                                <list-item><id>standby</id> - add <setting>standby_mode=on</setting> to the <file>postgresql.auto.conf</file> or <file>recovery.conf</file> file so cluster will start in standby mode.</list-item>
                                <list-item><id>none</id> - no <file>postgresql.auto.conf</file> or <file>recovery.conf</file> file is written so <postgres/> will attempt to achieve consistency using WAL segments present in <path>pg_xlog</path>/<path>pg_wal</path>. Provide the required WAL segments or use the <setting>archive-copy</setting> setting to include them with the backup.</list-item>
                            </list>

                            <admonition type="warning">Recovery <br-option>type=none</br-option> should be avoided because the timeline will not be incremented at the end of recovery. This can lead to, for example, <postgres/> attempting to archive duplicate WAL, which will be rejected, and may cause the disk to fill up and result in a <postgres/> panic. In addition, tools like <id>pg_rewind</id> may not work correctly or may cause corruption.</admonition>

                            <p>Note that the default restore <br-option>type</br-option> for offline backups is <id>none</id> since Point-in-Time-Recovery is not possible if <setting>wal_level=minimal</setting>. If <br-option>type</br-option> is set explicitly then it will be honored since Point-in-Time-Recovery is possible from offline backups as long as <setting>wal_level > minimal</setting>.</p>
                        </text>

                        <example>xid</example>
                    </option>

                    <option id="target" name="Target">
                        <summary>Recovery target.</summary>

                        <text>
                            <p>Defines the recovery target when <br-option>--type</br-option> is <id>lsn</id>, <id>name</id>, <id>xid</id>, or <id>time</id>. If the target is prior to the latest backup and <br-option>--type</br-option> is not <id>time</id> or <id>lsn</id>, then use the <br-option>--set</br-option> option to specify the backup set.</p>
                        </text>

                        <example>2015-01-30 14:15:11 EST</example>
                    </option>

                    <option id="target-exclusive" name="Target Exclusive">
                        <summary>Stop just before the recovery target is reached.</summary>

                        <text>
                            <p>Defines whether recovery to the target would be exclusive (the default is inclusive) and is only valid when <br-option>--type</br-option> is <id>lsn</id>, <id>time</id> or <id>xid</id>. For example, using <br-option>--target-exclusive</br-option> would exclude the contents of transaction <id>1007</id> when <br-option>--type=xid</br-option> and <br-option>--target=1007</br-option>. See the <setting>recovery_target_inclusive</setting> option in the <postgres/> docs for more information.</p>
                        </text>

                        <example>n</example>
                    </option>

                    <option id="target-action" name="Target Action">
                        <summary>Action to take when recovery target is reached.</summary>

                        <text>
                            <p>When <setting>hot_standby=on</setting>, the default since <postgres/> 10, this option consistently controls what the cluster does when the target is reached or there is no more WAL in the archive.</p>

                            <p>When <setting>hot_standby=off</setting> in <postgres/> &gt;= 12, <id>pause</id> acts like <id>shutdown</id>. When <setting>hot_standby=off</setting> in <postgres/> &lt; 12, <id>pause</id> acts like <id>promote</id>.</p>

                            <p>The following actions are supported:</p>

                            <list>
                                <list-item><id>pause</id> - pause when recovery target is reached.</list-item>
                                <list-item><id>promote</id> - promote and switch timeline when recovery target is reached.</list-item>
                                <list-item><id>shutdown</id> - shutdown server when recovery target is reached. (<postgres/> &gt;= 9.5)</list-item>
                            </list>
                        </text>

                        <example>promote</example>
                    </option>

                    <option id="target-timeline" name="Target Timeline">
                        <summary>Recover along a timeline.</summary>

                        <text>
                            <p>See <setting>recovery_target_timeline</setting> in the <postgres/> docs for more information.</p>
                        </text>

                        <example>3</example>
                    </option>
                </option-list>
            </command>

            <command id="info" name="Info">
                <summary>Retrieve information about backups.</summary>

                <text>
                    <p>The <cmd>info</cmd> command operates on a single stanza or all stanzas. Text output is the default and gives a human-readable summary of backups for the stanza(s) requested. This format is subject to change with any release.</p>

                    <p>For machine-readable output use <br-option>--output=json</br-option>. The JSON output contains far more information than the text output and is kept stable unless a bug is found.</p>

                    <p>To speed up execution, limit the output to only progress information by specifying <br-option>--detail-level=progress</br-option>. Note that this skips all checks except for availability of the stanza.</p>

                    <p>Each stanza has a separate section and it is possible to limit output to a single stanza with the <br-option>--stanza</br-option> option. The stanza '<id>status</id>' gives a brief indication of the stanza's health. If this is '<id>ok</id>' then <backrest/> is functioning normally. If there are multiple repositories, then a status of '<id>mixed</id>' indicates that the stanza is not in a healthy state on one or more of the repositories; in this case the state of the stanza will be detailed per repository. For cases in which an error on a repository occurred that is not one of the known error codes, then an error code of '<id>other</id>' will be used and the full error details will be provided. The '<id>wal archive min/max</id>' shows the minimum and maximum WAL currently stored in the archive and, in the case of multiple repositories, will be reported across all repositories unless the <br-option>{[dash]}-repo</br-option> option is set. Note that there may be gaps due to archive retention policies or other reasons.</p>

                    <p>The '<id>backup/expire running</id>' and/or '<id>restore running</id>' messages will appear beside the '<id>status</id>' information if any of those commands are currently running on the host.</p>

                    <p>The backups are displayed oldest to newest. The oldest backup will <i>always</i> be a full backup (indicated by an <id>F</id> at the end of the label) but the newest backup can be full, differential (ends with <id>D</id>), or incremental (ends with <id>I</id>).</p>

                    <p>The '<id>timestamp start/stop</id>' defines the time period when the backup ran. The '<id>timestamp stop</id>' can be used to determine the backup to use when performing Point-In-Time Recovery. More information about Point-In-Time Recovery can be found in the <link page="user-guide" section="/pitr">Point-In-Time Recovery</link> section.</p>

                    <p>The '<id>wal start/stop</id>' defines the WAL range that is required to make the database consistent when restoring. The <cmd>backup</cmd> command will ensure that this WAL range is in the archive before completing.</p>

                    <p>The '<id>database size</id>' is the full uncompressed size of the database while '<id>database backup size</id>' is the amount of data in the database to actually back up (these will be the same for full backups).</p>

                    <p>The '<id>repo</id>' indicates in which repository this backup resides. The '<id>backup set size</id>' includes all the files from this backup and any referenced backups in the repository that are required to restore the database from this backup while '<id>backup size</id>' includes only the files in this backup (these will also be the same for full backups). Repository sizes reflect compressed file sizes if compression is enabled in <backrest/>.</p>

                    <p>The '<id>backup reference total</id>' summarizes the list of additional backups that are required to restore this backup. Use the <br-option>--set</br-option> option to display the complete reference list.</p>

                    <!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
                </text>

                <option-list>
                    <option id="detail-level" name="Detail level">
                        <summary>Output detail level.</summary>

                        <text>
                            <p>The following levels are supported:</p>

                            <list>
                                <list-item><id>progress</id> - Output only the current backup/expire progress. This level cannot be used with the <br-option>--set</br-option> option.</list-item>
                                <list-item><id>full</id> - Output full info.</list-item>
                            </list>
                        </text>

                        <example>progress</example>
                    </option>

                    <option id="output" name="Output">
                        <summary>Output format.</summary>

                        <text>
                            <p>The following output types are supported:</p>

                            <list>
                                <list-item><id>text</id> - Human-readable summary of backup information.</list-item>
                                <list-item><id>json</id> - Exhaustive machine-readable backup information in JSON format.</list-item>
                            </list>
                        </text>

                        <example>json</example>
                    </option>

                    <option id="set" name="Set">
                        <summary>Backup set to detail.</summary>

                        <text>
                            <p>Details include a complete list of additional backups that are required to restore this backup, a list of databases (with OIDs) in the backup set (excluding template databases), tablespaces (with OIDs) with the destination where they will be restored by default, and symlinks with the destination where they will be restored when <setting>--link-all</setting> is specified.</p>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>

                    <option id="type" name="Type">
                        <summary>Filter on backup type.</summary>

                        <text>
                            <p>Filter the output using one of the following backup types:</p>

                            <list>
                                <list-item><id>full</id> - Output only full backups.</list-item>
                                <list-item><id>diff</id> - Output only differential backups.</list-item>
                                <list-item><id>incr</id> - Output only incremental backups.</list-item>
                            </list>
                        </text>

                        <example>full</example>
                    </option>
                </option-list>
            </command>

            <command id="help" name="Help">
                <summary>Get help.</summary>

                <text>
                    <p>Three levels of help are provided. If no command is specified then general help will be displayed. If a command is specified (e.g. <cmd>pgbackrest help backup</cmd>) then a full description of the command will be displayed along with a list of valid options. If an option is specified in addition to a command (e.g. <cmd>pgbackrest help backup type</cmd>) then a full description of the option as it applies to the command will be displayed.</p>
                </text>

                <option-list>
                    <option id="help" name="Display Help">
                        <summary>Display help.</summary>

                        <text>
                            <p>Displays help even if the <cmd>help</cmd> command is not specified and overrides the <br-option>--version</br-option> option.</p>
                        </text>

                        <example>y</example>
                    </option>

                    <option id="version" name="Display Version">
                        <summary>Display version.</summary>

                        <text>
                            <p>Displays version even if the <cmd>version</cmd> or <cmd>help</cmd> command is not specified.</p>
                        </text>

                        <example>y</example>
                    </option>
                </option-list>
            </command>

            <command id="server" name="Server">
                <summary><backrest/> server.</summary>

                <text>
                    <p>The <backrest/> server allows access to remote hosts without using the <proper>SSH</proper> protocol.</p>
                </text>
            </command>

            <command id="server-ping" name="Server Ping">
                <summary>Ping <backrest/> server.</summary>

                <text>
                    <p>Ping a <backrest/> <proper>TLS</proper> server to ensure it is accepting connections. This serves as an aliveness check only since no authentication is attempted.</p>

                    <p>If no host is specified on the command-line then the <br-option>tls-server-host</br-option> option will be used.</p>
                </text>
            </command>

            <command id="start" name="Start">
                <summary>Allow <backrest/> processes to run.</summary>

                <text>
                    <p>If the <backrest/> processes were previously stopped using the <cmd>stop</cmd> command then they can be started again using the <cmd>start</cmd> command. Note that this will not immediately start up any <backrest/> processes but they are allowed to run. See <link page="user-guide" section="/start-stop">Starting and Stopping</link> for more information and examples.</p>
                </text>
            </command>

            <command id="stop" name="Stop">
                <summary>Stop <backrest/> processes from running.</summary>

                <text>
                    <p>Does not allow any new <backrest/> processes to run. By default running processes will be allowed to complete successfully. Use the <setting>--force</setting> option to terminate running processes.</p>

                    <p><backrest/> processes will return an error if they are run after the stop command completes. See <link page="user-guide" section="/start-stop">Starting and Stopping</link> for more information and examples.</p>
                </text>

                <option-list>
                    <option id="force" name="Force">
                        <summary>Force all <backrest/> processes to stop.</summary>

                        <text>
                            <p>This option will send TERM signals to all running <backrest/> processes to effect a graceful but immediate shutdown. Note that this will also shutdown processes that were initiated on another system but have remotes running on the current system. For instance, if a backup was started on the backup server then running <cmd>stop --force</cmd> on the database server will shutdown the backup process on the backup server.</p>
                        </text>

                        <example>y</example>
                    </option>
                </option-list>
            </command>

            <command id="verify" name="Verify">
                <summary>Verify contents of a repository.</summary>

                <text>
                    <p>Verify determines if the backups and archives in a repository are valid.</p>
                </text>

                <option-list>
                    <option id="set" name="Set">
                        <summary>Backup set to verify.</summary>

                        <text>
                            <p>Verify all database and archive files associated with the specified backup set.</p>
                        </text>

                        <example>20150131-153358F_20150131-153401I</example>
                    </option>

                    <option id="output" name="Output">
                        <summary>Output type.</summary>

                        <text>
                            <p>The following output types are supported:</p>
                                <list>
                                    <list-item><id>none</id> - No verify output.</list-item>
                                    <list-item><id>text</id> - Output verify information to stdout.</list-item>
                                </list>
                        </text>

                        <example>text</example>
                    </option>

                    <option id="verbose" name="Verbose">
                        <summary>Verbose output.</summary>

                        <text>
                            <p>Verbose defaults to false, providing a minimal response with important information about errors in the repository. Specifying true provides more information about what was successfully verified.</p>
                        </text>

                        <example>y</example>
                    </option>
                </option-list>
            </command>

            <command id="version" name="Version">
                <summary>Get version.</summary>

                <text>
                    <p>Displays installed <backrest/> version.</p>
                </text>

                <option-list>
                    <option id="output" name="Output">
                        <summary>Output type.</summary>

                        <text>
                            <p>The following output types are supported:</p>
                            <list>
                                <list-item><id>text</id> - Display the installed <backrest/> version as text.</list-item>
                                <list-item><id>num</id> - Display the installed <backrest/> version as an integer.</list-item>
                            </list>
                        </text>

                        <example>num</example>
                    </option>
                </option-list>
            </command>

            <command id="stanza-create" name="Stanza Create">
                <summary>Create the required stanza data.</summary>

                <text>
                    <p>The <cmd>stanza-create</cmd> command must be run after the stanza has been configured in <file>pgbackrest.conf</file>. If there is more than one repository configured, the stanza will be created on each. Stanzas that have already been created will be skipped so it is always safe to run <cmd>stanza-create</cmd>, even when a new repository has been configured.</p>

                    <p>See <link page="user-guide" section="/quickstart/create-stanza">Create the Stanza</link> for more information and an example.</p>
                </text>

                <option-list>
                    <option id="force" name="Force">
                        <summary>Force stanza creation.</summary>

                        <text>
                            <p>This option is no longer supported.</p>
                        </text>

                        <example>n</example>
                    </option>

                    <option id="online" name="Online">
                        <summary>Create on an online cluster.</summary>

                        <text>
                            <p>Specifying --no-online prevents <backrest/> from connecting to <postgres/> when creating the stanza.</p>
                        </text>

                        <example>n</example>
                    </option>
                </option-list>
            </command>

            <command id="stanza-upgrade" name="Stanza Upgrade">
                <summary>Upgrade a stanza.</summary>

                <text>
                    <p>Immediately after upgrading <postgres/> to a newer major version, the <br-option>pg-path</br-option> for all <backrest/> configurations must be set to the new database location and the <cmd>stanza-upgrade</cmd> command run. If there is more than one repository configured on the host, the stanza will be upgraded on each. If the database is offline use the <br-option>--no-online</br-option> option.</p>

                    <!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
                </text>

                <option-list>
                    <option id="online" name="Online">
                        <summary>Update an online cluster.</summary>

                        <text>
                            <p>Specifying --no-online prevents <backrest/> from connecting to <postgres/> when upgrading the stanza.</p>
                        </text>

                        <example>n</example>
                    </option>
                </option-list>
            </command>

            <command id="stanza-delete" name="Stanza Delete">
                <summary>Delete a stanza.</summary>

                <text>
                    <p>The <cmd>stanza-delete</cmd> command removes data in the repository associated with a stanza.</p>

                    <admonition type="warning">Use this command with caution &amp;mdash; it will permanently remove all backups and archives from the <backrest/> repository for the specified stanza.</admonition>

                    <p>To delete a stanza:</p>

                    <list>
                        <list-item>Shut down the <postgres/> cluster associated with the stanza (or use --force to override).</list-item>
                        <list-item>Run the <cmd>stop</cmd> command on the host where the <cmd>stanza-delete</cmd> command will be run.</list-item>
                        <list-item>Run the <cmd>stanza-delete</cmd> command.</list-item>
                    </list>

                    <p>Once the command successfully completes, it is the responsibility of the user to remove the stanza from all <backrest/> configuration files and/or environment variables.</p>

                    <p>A stanza may only be deleted from one repository at a time. To delete the stanza from multiple repositories, repeat the <cmd>stanza-delete</cmd> command for each repository while specifying the <br-option>{[dash]}-repo</br-option> option.</p>

                    <!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
                </text>

                <option-list>
                    <option id="force" name="Force">
                        <summary>Force stanza delete.</summary>

                        <text>
                            <p>If <postgres/> is still running for the stanza, then this option can be used to force the stanza to be deleted from the repository.</p>
                        </text>

                        <example>n</example>
                    </option>
                </option-list>
            </command>
        </command-list>
    </operation>
</doc>
