1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
pgbackrest/doc/xml/reference.xml

1735 lines
120 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE doc SYSTEM "doc.dtd">
<doc title="{[project]} Command &amp; Configuration Reference">
<!-- CONFIG -->
<config title="{[project]} Configuration Reference">
<description>The {[project]} Configuration Reference details all configuration options.</description>
<text><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.</text>
<config-section-list title="Settings">
<!-- CONFIG - LOG -->
<config-section id="log" name="Log">
<text>The <setting>log</setting> section defines logging-related settings.<admonition type="caution">Trace-level logging may expose secrets such as keys and passwords. Use with caution!</admonition></text>
<!-- CONFIG - LOG SECTION - LOG-LEVEL-FILE KEY -->
<config-key-list>
<config-key id="log-level-file" name="File Log Level">
<summary>Level for file logging.</summary>
<text>The following log levels are supported:
<ul>
<li><id>off</id> - No logging at all (not recommended)</li>
<li><id>error</id> - Log only errors</li>
<li><id>warn</id> - Log warnings and errors</li>
<li><id>info</id> - Log info, warnings, and errors</li>
<li><id>detail</id> - Log detail, info, warnings, and errors</li>
<li><id>debug</id> - Log debug, detail, info, warnings, and errors</li>
<li><id>trace</id> - Log trace (very verbose debugging), debug, info, warnings, and errors</li>
</ul></text>
<example>debug</example>
</config-key>
<!-- CONFIG - LOG SECTION - LOG-LEVEL-CONSOLE KEY -->
<config-key id="log-level-console" name="Console Log Level">
<summary>Level for console logging.</summary>
<text>The following log levels are supported:
<ul>
<li><id>off</id> - No logging at all (not recommended)</li>
<li><id>error</id> - Log only errors</li>
<li><id>warn</id> - Log warnings and errors</li>
<li><id>info</id> - Log info, warnings, and errors</li>
<li><id>detail</id> - Log detail, info, warnings, and errors</li>
<li><id>debug</id> - Log debug, detail, info, warnings, and errors</li>
<li><id>trace</id> - Log trace (very verbose debugging), debug, info, warnings, and errors</li>
</ul></text>
<example>error</example>
</config-key>
<!-- CONFIG - LOG SECTION - LOG-LEVEL-STDERR KEY -->
<config-key id="log-level-stderr" name="Std Error Log Level">
<summary>Level for stderr logging.</summary>
<text>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>.
The following log levels are supported:
<ul>
<li><id>off</id> - No logging at all (not recommended)</li>
<li><id>error</id> - Log only errors</li>
<li><id>warn</id> - Log warnings and errors</li>
<li><id>info</id> - Log info, warnings, and errors</li>
<li><id>detail</id> - Log detail, info, warnings, and errors</li>
<li><id>debug</id> - Log debug, detail, info, warnings, and errors</li>
<li><id>trace</id> - Log trace (very verbose debugging), debug, info, warnings, and errors</li>
</ul></text>
<example>error</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - LOG-PATH KEY -->
<config-key id="log-path" name="Log Path">
<summary>Path where log files are stored.</summary>
<text>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.</text>
<example>/backup/db/log</example>
</config-key>
<!-- CONFIG - LOG SECTION - LOG-TIMESTAMP KEY -->
<config-key id="log-timestamp" name="Log Timestamp">
<summary>Enable timestamp in logging.</summary>
<text>Enables the timestamp in console and file logging. This option is disabled in special situations such as generating documentation.</text>
<example>n</example>
</config-key>
<!-- CONFIG - LOG SECTION - LOG-SUBPROCESS KEY -->
<config-key id="log-subprocess" name="Log Subprocesses">
<summary>Enable logging in subprocesses.</summary>
<text>Enable file logging for any subprocesses created by this process using the log level specified by <br-option>log-level-file</br-option>.</text>
<example>y</example>
</config-key>
</config-key-list>
</config-section>
<!-- CONFIG - GENERAL -->
<config-section id="general" name="General">
<text>The <setting>general</setting> section defines options that are common for many commands.</text>
<config-key-list>
<config-key id="buffer-size" name="Buffer Size">
<summary>Buffer size for file operations.</summary>
<text>Set the buffer size used for copy, compress, and uncompress functions. A maximum of 3 buffers will be in use at a time per process. An additional maximum of 256K per process may be used for zlib buffers.
Size can be entered in bytes (default) or KB, MB, GB, TB, or PB where the multiplier is a power of 1024. For example, the case-insensitive value 32k (or 32KB) can be used instead of 32768.
Allowed values, in bytes, are <id>16384</id>, <id>32768</id>, <id>65536</id>, <id>131072</id>, <id>262144</id>, <id>524288</id>, <id>1048576</id>, <id>2097152</id>, <id>4194304</id>, <id>8388608</id>, and <id>16777216</id>.</text>
<example>32K</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - CMD-SSH KEY -->
<config-key id="cmd-ssh" name="SSH client command">
<summary>Path to ssh client executable.</summary>
<text>Use a specific SSH client when an alternate is desired or the <file>ssh</file> executable is not in $PATH.</text>
<example>/usr/bin/ssh</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - COMPRESS -->
<config-key id="compress" name="Compress">
<summary>Use file compression.</summary>
<text>Backup files are compatible with command-line compression tools.
This option is now deprecated. The <setting>compress-type</setting> option should be used instead.</text>
<example>n</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - COMPRESS-TYPE -->
<config-key id="compress-type" name="Compress Type">
<summary>File compression type.</summary>
<text>The following compression types are supported:
<ul>
<li><id>none</id> - no compression</li>
<li><id>bz2</id> - bzip2 compression format</li>
<li><id>gz</id> - gzip compression format</li>
<li><id>lz4</id> - lz4 compression format (not available on all platforms)</li>
<li><id>zst</id> - Zstandard compression format (not available on all platforms)</li>
</ul></text>
<example>none</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - COMPRESS-LEVEL KEY -->
<config-key id="compress-level" name="Compress Level">
<summary>File compression level.</summary>
<text>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).
The following are the defaults levels based on <setting>compress-type</setting> when <setting>compress-level</setting> is not specified:
<ul>
<li><id>bz2</id> - 9</li>
<li><id>gz</id> - 6</li>
<li><id>lz4</id> - 1</li>
<li><id>zst</id> - 3</li>
</ul></text>
<allow>0-9</allow>
<example>9</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - COMPRESS-LEVEL-NETWORK KEY -->
<config-key id="compress-level-network" name="Network Compress Level">
<summary>Network compression level.</summary>
<text>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 but can be disabled by setting <setting>compress-level-network=0</setting>. 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. SSH compression is always disabled.</text>
<allow>0-9</allow>
<example>1</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - DB-TIMEOUT KEY -->
<config-key id="db-timeout" name="Database Timeout">
<summary>Database query timeout.</summary>
<text>Sets the timeout, in seconds, for queries against the database. This includes the <code>pg_start_backup()</code> and <code>pg_stop_backup()</code> 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>startfast=y</setting> and you know that the database cluster will not generate many WAL segments during the backup). <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 - GENERAL SECTION - DELTA OPTION -->
<config-key id="delta" name="Delta">
<summary>Restore or backup using checksums.</summary>
<text>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.
During a backup, this option will use checksums instead of the timestamps to determine if files will be copied.</text>
<example>y</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - IO-TIMEOUT KEY -->
<config-key id="io-timeout" name="I/O Timeout">
<summary>I/O timeout.</summary>
<text>Timeout, in seconds, used for connections and read/write operations.
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.</text>
<example>120</example>
</config-key>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<!-- CONFIG - GENERAL SECTION - LOCK-PATH KEY -->
<config-key id="lock-path" name="Lock Path">
<summary>Path where lock files are stored.</summary>
<text>The lock path provides a location for <backrest/> to create lock files to prevent conflicting operations from being run concurrently.</text>
<example>/backup/db/lock</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - NEUTRAL-UMASK -->
<config-key id="neutral-umask" name="Neutral Umask">
<summary>Use a neutral umask.</summary>
<text>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.
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.</text>
<example>n</example>
</config-key>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<!-- CONFIG - GENERAL SECTION - LOG-PATH KEY -->
<config-key id="spool-path" name="Spool Path">
<summary>Path where transient data is stored.</summary>
<text>This path is used to store data for the asynchronous <cmd>archive-push</cmd> and <cmd>archive-get</cmd> command.
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).
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>.
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>.
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>.</text>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<example>/backup/db/spool</example>
</config-key>
2016-09-06 15:35:02 +02:00
<!-- CONFIG - GENERAL SECTION - PROCESS-MAX -->
<config-key id="process-max" name="Process Maximum">
<summary>Max processes to use for compress/transfer.</summary>
2016-09-06 15:35:02 +02:00
<text>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.</text>
<example>4</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - PROTOCOL-TIMEOUT KEY -->
<config-key id="protocol-timeout" name="Protocol Timeout">
<summary>Protocol timeout.</summary>
<text>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. <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 - GENERAL SECTION - SCK-KEEP-ALIVE KEY -->
<config-key id="sck-keep-alive" name="Keep Alive">
<summary>Keep-alive enable.</summary>
<text>Enables keep-alive messages on socket connections.</text>
<example>n</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - TCP-KEEP-ALIVE-COUNT KEY -->
<config-key id="tcp-keep-alive-count" name="Keep Alive Count">
<summary>Keep-alive count.</summary>
<text>Specifies the number of TCP keep-alive messages that can be lost before the connection is considered dead.
This option is available on systems that support the <code>TCP_KEEPCNT</code> socket option.</text>
<example>3</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - TCP-KEEP-ALIVE-IDLE KEY -->
<config-key id="tcp-keep-alive-idle" name="Keep Alive Idle">
<summary>Keep-alive idle time.</summary>
<text>Specifies the amount of time (in seconds) with no network activity after which the operating system should send a TCP keep-alive message.
This option is available on systems that support the <code>TCP_KEEPIDLE</code> socket option.</text>
<example>60</example>
</config-key>
<!-- CONFIG - GENERAL SECTION - TCP-KEEP-ALIVE-INTERVAL KEY -->
<config-key id="tcp-keep-alive-interval" name="Keep Alive Interval">
<summary>Keep-alive interval time.</summary>
<text>Specifies the amount of time (in seconds) after which a TCP keep-alive message that has not been acknowledged should be retransmitted.
This option is available on systems that support the <code>TCP_KEEPINTVL</code> socket option.</text>
<example>30</example>
</config-key>
</config-key-list>
</config-section>
<!-- CONFIG - REPO -->
<config-section id="repository" name="Repository">
<text>The <setting>repository</setting> section defines options used to configure the repository.
<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).
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.</text>
<config-key-list>
<!-- ======================================================================================================= -->
<config-key id="repo-azure-account" name="Azure Repository Account">
<summary>Azure repository account.</summary>
<text>Azure account used to store the repository.</text>
<example>pg-backup</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-azure-container" name="Azure Repository Container">
<summary>Azure repository container.</summary>
<text>Azure container used to store the repository.
<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.</text>
<example>pg-backup</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-azure-endpoint" name="Azure Repository Endpoint">
<summary>Azure repository endpoint.</summary>
<text>Endpoint used to connect to the blob service. The default is generally correct unless using Azure Government.
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.</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>A shared key or shared access signature depending on the <br-option>repo-azure-key-type</br-option> option.</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>The following types are supported for authorization:
<ul>
<li><id>shared</id> - Shared key</li>
<li><id>sas</id> - Shared access signature</li>
</ul></text>
<example>sas</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-gcs-bucket" name="GCS Repository Bucket">
<summary>GCS repository bucket.</summary>
<text>GCS bucket used to store the repository.
<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.</text>
<example>/pg-backup</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-gcs-endpoint" name="GCS Repository Endpoint">
<summary>GCS repository endpoint.</summary>
<text>Endpoint used to connect to the storage service. May be updated to use a local GCS server or alternate endpoint.</text>
<example>localhost</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-gcs-key" name="GCS Repository Key">
<summary>GCS repository key.</summary>
<text>A token or service key file depending on the <br-option>repo-gcs-key-type</br-option> option.</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>The following types are supported for authorization:
<ul>
<li><id>service</id> - Service account from locally stored key.</li>
<li><id>token</id> - For local testing, e.g. <file>fakegcs</file>.</li>
</ul></text>
<example>none</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST KEY -->
<config-key id="repo-host" name="Repository Host">
<summary>Repository host when operating remotely via SSH.</summary>
<text>Make sure that trusted SSH authentication is configured between the <postgres/> host and the repository host.
When backing up and archiving to a locally mounted filesystem this setting is not required.</text>
<example>repo1.domain.com</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST-CMD KEY -->
<config-key id="repo-host-cmd" name="Repository Host Command">
<summary><backrest/> exe path on the repository host.</summary>
<text>Required only if the path to <exe/> is different on the local and repository hosts. If not defined, the repository host exe path will be set the same as the local exe path.</text>
<default>same as local</default>
<example>/usr/lib/backrest/bin/pgbackrest</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST-CONFIG KEY -->
<config-key id="repo-host-config" name="Repository Host Configuration">
<summary><backrest/> repository host configuration file.</summary>
<text>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.</text>
<example>/conf/pgbackrest/pgbackrest.conf</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST-CONFIG-INCLUDE-PATH KEY -->
<config-key id="repo-host-config-include-path" name="Repository Host Configuration Include Path">
<summary><backrest/> repository host configuration include path.</summary>
<text>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.</text>
<example>/conf/pgbackrest/conf.d</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST-CONFIG-PATH KEY -->
<config-key id="repo-host-config-path" name="Repository Host Configuration Path">
<summary><backrest/> repository host configuration path.</summary>
<text>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.</text>
<example>/conf/pgbackrest</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST-USER KEY -->
<config-key id="repo-host-user" name="Repository Host User">
<summary>Repository host user when <setting>repo-host</setting> is set.</summary>
<text>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.</text>
<example>repo-user</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HOST-PORT KEY -->
<config-key id="repo-host-port" name="Repository Host Port">
<summary>Repository host port when <setting>repo-host</setting> is set.</summary>
<text>Use this option to specify a non-default port for the repository host protocol. Currently only SSH is supported</text>
<example>25</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-HARDLINK -->
<config-key id="repo-hardlink" name="Repository Hardlink">
<summary>Hardlink files between backups in the repository.</summary>
<text>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.</text>
<example>y</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-PATH KEY -->
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<config-key id="repo-path" name="Repository Path">
2018-01-23 20:34:24 +02:00
<summary>Path where backups and archive are stored.</summary>
2018-01-23 20:34:24 +02:00
<text>The repository is where <backrest/> stores backups and archives WAL segments.
2018-01-23 20:34:24 +02:00
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.</text>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<example>/backup/db/backrest</example>
</config-key>
<!-- CONFIG - RETENTION SECTION - REPO-RETENTION-FULL KEY -->
<config-key id="repo-retention-full" name="Full Retention">
<summary>Full backup retention count/time.</summary>
<text>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.</text>
<example>2</example>
</config-key>
<!-- CONFIG - RETENTION SECTION - REPO-RETENTION-FULL-TYPE KEY -->
<config-key id="repo-retention-full-type" name="Full Retention Type">
<summary>Retention type for full backups.</summary>
<text>Determines whether the <setting>repo-retention-full</setting> setting represents a time period (days) or count of full backups to keep. 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 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.</text>
<example>time</example>
</config-key>
<!-- CONFIG - RETENTION SECTION - REPO-DIFFERENTIAL-RETENTION KEY -->
<config-key id="repo-retention-diff" name="Differential Retention">
<summary>Number of differential backups to retain.</summary>
<text>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.</text>
<example>3</example>
</config-key>
<!-- CONFIG - RETENTION SECTION - REPO-ARCHIVE-RETENTION-TYPE KEY -->
<config-key id="repo-retention-archive-type" name="Archive Retention Type">
<summary>Backup type for WAL retention.</summary>
<text>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.</text>
<example>diff</example>
</config-key>
<!-- CONFIG - RETENTION SECTION - REPO-ARCHIVE-RETENTION 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>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.
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.</text>
<example>2</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-KEY KEY -->
2017-06-12 16:52:32 +02:00
<config-key id="repo-s3-key" name="S3 Repository Access Key">
<summary>S3 repository access key.</summary>
<text>AWS key used to access this bucket.</text>
<example>AKIAIOSFODNN7EXAMPLE</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-KEY-SECRET KEY -->
2017-06-12 16:52:32 +02:00
<config-key id="repo-s3-key-secret" name="S3 Repository Secret Access Key">
<summary>S3 repository secret access key.</summary>
<text>AWS secret key used to access this bucket.</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>The following types are supported:
<ul>
<li><id>shared</id> - Shared keys</li>
<li><id>auto</id> - Automatically retrieve temporary credentials</li>
</ul></text>
<example>auto</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-TOKEN KEY -->
<config-key id="repo-s3-token" name="S3 Repository Security Token">
<summary>S3 repository security token.</summary>
<text>AWS security token used with temporary credentials.</text>
<example>AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22 ...</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-BUCKET KEY -->
2017-06-12 16:52:32 +02:00
<config-key id="repo-s3-bucket" name="S3 Repository Bucket">
<summary>S3 repository bucket.</summary>
<text>S3 bucket used to store the repository.
<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.</text>
<example>pg-backup</example>
2017-06-12 16:52:32 +02:00
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-ENDPOINT KEY -->
2017-06-12 16:52:32 +02:00
<config-key id="repo-s3-endpoint" name="S3 Repository Endpoint">
<summary>S3 repository endpoint.</summary>
<text>The AWS endpoint should be valid for the selected region.
2017-06-12 16:52:32 +02:00
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.</text>
<example>s3.amazonaws.com</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-s3-role" name="S3 Repository Role">
<summary>S3 repository role.</summary>
<text>The AWS role name (not the full ARN) used to retrieve temporary credentials when <br-option>repo-s3-key-type=auto</br-option>.</text>
<example>authrole</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-REGION KEY -->
2017-06-12 16:52:32 +02:00
<config-key id="repo-s3-region" name="S3 Repository Region">
<summary>S3 repository region.</summary>
<text>The AWS region where the bucket was created.</text>
<example>us-east-1</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-S3-URI-STYLE KEY -->
<config-key id="repo-s3-uri-style" name="S3 Repository URI Style">
<summary>S3 URI Style.</summary>
<text>The following URI styles are supported:
<ul>
<li><id>host</id> - Connect to <id>bucket.endpoint</id> host.</li>
<li><id>path</id> - Connect to <id>endpoint</id> host and prepend bucket to URIs.</li>
</ul></text>
<example>path</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-storage-ca-file" name="Repository Storage CA File">
<summary>Repository storage CA file.</summary>
<text>Use a CA file other than the system default for storage (e.g. S3, Azure) certificates.</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>Use a CA path other than the system default for storage (e.g. S3, Azure) certificates.</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>Connect to a host other than the storage (e.g. S3, Azure) endpoint. This is typically used for testing.</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>Port to use when connecting to the storage (e.g. S3, Azure) endpoint (or host if specified).</text>
<example>9000</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="repo-storage-verify-tls" name="Repository Storage Certificate Verify">
<summary>Repository storage certificate verify.</summary>
2017-06-12 16:52:32 +02:00
<text>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.</text>
2017-06-12 16:52:32 +02:00
<example>n</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-TYPE KEY -->
<config-key id="repo-type" name="Repository Type">
<summary>Type of storage used for the repository.</summary>
<text>The following repository types are supported:
<ul>
<li><id>azure</id> - Azure Blob Storage Service</li>
<li><id>cifs</id> - Like <id>posix</id>, but disables links and directory fsyncs</li>
<li><id>gcs</id> - Google Cloud Storage</li>
<li><id>posix</id> - Posix-compliant file systems</li>
2017-06-12 16:52:32 +02:00
<li><id>s3</id> - AWS Simple Storage Service</li>
</ul>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>.</text>
<example>cifs</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-CIPHER-TYPE KEY -->
<config-key id="repo-cipher-type" name="Repository Cipher Type">
<summary>Cipher used to encrypt the repository.</summary>
<text>The following cipher types are supported:
<ul>
<li><id>none</id> - The repository is not encrypted</li>
<li><id>aes-256-cbc</id> - Advanced Encryption Standard with 256 bit key length</li>
</ul>Note that encryption is always performed client-side even if the repository type (e.g. S3) supports encryption.</text>
<default>none</default>
<example>aes-256-cbc</example>
</config-key>
<!-- CONFIG - REPO SECTION - REPO-CIPHER-PASS KEY -->
<config-key id="repo-cipher-pass" name="Repository Cipher Passphrase">
<summary>Repository cipher passphrase.</summary>
<text>Passphrase used to encrypt/decrypt files of the repository.</text>
<example>zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO</example>
</config-key>
</config-key-list>
</config-section>
<!-- CONFIG - BACKUP -->
<config-section id="backup" name="Backup">
<text>The <setting>backup</setting> section defines settings related to backup.</text>
<config-key-list>
<!-- CONFIG - BACKUP SECTION - ARCHIVE-CHECK -->
<config-key id="archive-check" name="Check Archive">
2018-01-23 20:34:24 +02:00
<summary>Check that WAL segments are in the archive before backup completes.</summary>
<text>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.
This option must be enabled if <br-option>archive-copy</br-option> is enabled.</text>
<example>n</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - ARCHIVE-COPY -->
<config-key id="archive-copy" name="Copy Archive">
<summary>Copy WAL segments needed for consistency to the backup.</summary>
<text>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.
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.
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>.
The <br-option>archive-check</br-option> option must be enabled if <br-option>archive-copy</br-option> is enabled.</text>
<example>y</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="archive-header-check" name="Check WAL Headers">
<summary>Check PostgreSQL version/id in WAL headers.</summary>
<text>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.
Therefore, disabling this check is fairly safe but should only be done when needed, e.g. if the WAL is encrypted.</text>
<example>n</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="archive-mode-check" name="Check Archive Mode">
<summary>Check the <postgres/> <setting>archive_mode</setting> setting.</summary>
<text>Enabled by default, this option disallows <postgres/> <setting>archive_mode=always</setting>.
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.
<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 - BACKUP SECTION - BACKUP-STANDBY KEY -->
<config-key id="backup-standby" name="Backup from Standby">
<summary>Backup from the standby cluster.</summary>
<text>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.</text>
<example>y</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - CHECKSUM-PAGE KEY -->
<config-key id="checksum-page" name="Page Checksums">
<summary>Validate data page checksums.</summary>
<text>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.
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.</text>
<example>n</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - EXCLUDE KEY -->
<config-key id="exclude" name="Path/File Exclusions">
<summary>Exclude paths/files from the backup.</summary>
<text>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.
<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>
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.<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>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.
Multiple exclusions may be specified on the command-line or in a configuration file.</text>
<example>junk/</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - MANIFEST-SAVE-THRESHOLD -->
<config-key id="manifest-save-threshold" name="Manifest Save Threshold">
<summary>Manifest save threshold during backup.</summary>
<text>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.
Size can be entered in bytes (default) or KB, MB, GB, TB, or PB where the multiplier is a power of 1024.</text>
<example>5G</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - EXPIRE-AUTO -->
<config-key id="expire-auto" name="Expire Auto">
<summary>Automatically run the <cmd>expire</cmd> command after a successful backup.</summary>
<text>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.</text>
<example>y</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - RESUME -->
<config-key id="resume" name="Resume">
<summary>Allow resume of failed backup.</summary>
<text>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.</text>
<example>n</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - START-FAST -->
<config-key id="start-fast" name="Start Fast">
<summary>Force a checkpoint to start backup quickly.</summary>
<text>Forces a checkpoint (by passing <id>y</id> to the <id>fast</id> parameter of <code>pg_start_backup()</code>) so the backup begins immediately. Otherwise the backup will start after the next regular checkpoint.
This feature only works in <postgres/> &gt;= <id>8.4</id>.</text>
<example>y</example>
</config-key>
<!-- CONFIG - BACKUP SECTION - STOP-AUTO -->
<config-key id="stop-auto" name="Stop Auto">
<summary>Stop prior failed backup on new backup.</summary>
<text>This will only be done if an exclusive advisory lock can be acquired to demonstrate that the prior failed backup process has really stopped.
This feature relies on pg_is_in_backup() so only works on <postgres/> >= <id>9.3</id>.
This feature is not supported for <postgres/> >= <id>9.6</id> since backups are run in non-exclusive mode.
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.</text>
<example>y</example>
</config-key>
</config-key-list>
</config-section>
<!-- CONFIG - ARCHIVE -->
<config-section id="archive" name="Archive">
<text>The <setting>archive</setting> section defines options for the <cmd>archive-push</cmd> and <cmd>archive-get</cmd> commands.</text>
<config-key-list>
<!-- CONFIG - ARCHIVE SECTION - ARCHIVE-ASYNC KEY -->
<config-key id="archive-async" name="Asynchronous Archiving">
<summary>Push/get WAL segments asynchronously.</summary>
<text>Enables asynchronous operation for the <cmd>archive-push</cmd> and <cmd>archive-get</cmd> commands.
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.</text>
<example>y</example>
</config-key>
<!-- CONFIG - ARCHIVE SECTION - ARCHIVE-GET-QUEUE-MAX 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>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/>.
Size can be entered in bytes (default) or KB, MB, GB, TB, or PB where the multiplier is a power of 1024.</text>
<example>1073741824</example>
</config-key>
<!-- CONFIG - ARCHIVE SECTION - ARCHIVE-QUEUE-MAX KEY -->
<config-key id="archive-push-queue-max" name="Maximum Archive Push Queue Size">
<summary>Maximum size of the <postgres/> archive queue.</summary>
<text>After the limit is reached, the following will happen:
<ol>
<li><backrest/> will notify <postgres/> that the WAL was successfully archived, then <b>DROP IT</b>.</li>
<li>A warning will be output to the Postgres log.</li>
2016-01-16 03:31:29 +02:00
</ol>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.
In asynchronous mode the entire queue will be dropped to prevent spurts of WAL getting through before the queue limit is exceeded again.
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.
Size can be entered in bytes (default) or KB, MB, GB, TB, or PB where the multiplier is a power of 1024.</text>
<example>1GB</example>
</config-key>
<!-- ======================================================================================================= -->
<config-key id="archive-timeout" name="Archive Timeout">
<summary>Archive timeout.</summary>
<text>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.</text>
<example>30</example>
</config-key>
</config-key-list>
</config-section>
<!-- CONFIG - RESTORE -->
<config-section id="restore" name="Restore">
<text>The <setting>restore</setting> section defines settings used for restoring backups.</text>
<config-key-list>
<!-- ======================================================================================================= -->
<config-key id="archive-mode" name="Archive Mode">
<summary>Preserve or disable archiving on restored cluster.</summary>
<text>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.
The following modes are supported:
<ul>
<li><id>off</id> - disable archiving by setting <setting>archive_mode=off</setting>.</li>
<li><id>preserve</id> - preserve current <setting>archive_mode</setting> setting.</li>
</ul><b>NOTE</b>: This option is not available on <postgres/> &amp;lt; 12.</text>
<example>off</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - DB-INCLUDE KEY -->
<config-key id="db-include" name="Include Database">
<summary>Restore only specified databases.</summary>
<text>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. <admonition type="note">built-in databases (<id>template0</id>, <id>template1</id>, and <id>postgres</id>) are always restored.</admonition>The <setting>{[dash]}-db-include</setting> option can be passed multiple times to specify more than one database to include.
See <link page="user-guide" section="/restore/option-db-include">Restore Selected Databases</link> for additional information and caveats.</text>
<example>db_main</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - LINK-ALL KEY -->
<config-key id="link-all" name="Link All">
<summary>Restore all symlinks.</summary>
<text>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.</text>
<example>y</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - LINK-MAP KEY -->
<config-key id="link-map" name="Link Map">
<summary>Modify the destination of a symlink.</summary>
<text>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.</text>
<example>pg_xlog=/data/xlog</example>
</config-key>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<!-- CONFIG - RESTORE SECTION - RECOVERY-OPTION KEY -->
<config-key id="recovery-option" name="Recovery Option">
<summary>Set an option in <file>recovery.conf</file>.</summary>
<text>See http://www.postgresql.org/docs/X.X/static/recovery-config.html for details on recovery.conf options (replace X.X with your <postgres/> version). This option can be used multiple times.<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>Since <backrest/> does not start <postgres/> after writing the <file>recovery.conf</file> file, it is always possible to edit/check <file>recovery.conf</file> before manually restarting.</text>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<example>primary_conninfo=db.mydomain.com</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - TABLESPACE-MAP KEY -->
<config-key id="tablespace-map" name="Tablespace Map">
<summary>Restore a tablespace into the specified directory.</summary>
New simpler configuration and consistent project/exe/path naming. * The repo-path option now always refers to the repository where backups and archive are stored, whether local or remote, so the repo-remote-path option has been removed. The new spool-path option can be used to define a location for queueing WAL segments when archiving asynchronously. Otherwise, a local repository is no longer required. * Implemented a new config format which should be far simpler to use. See the User Guide and Configuration Reference for details but for a simple configuration all options can now be placed in the stanza section. Options that are shared between stanzas can be placed in the [global] section. More complex configurations can still make use of command sections though this should be a rare use case. * The default configuration filename is now pgbackrest.conf instead of pg_backrest.conf. This was done for consistency with other naming changes but also to prevent old config files from being loaded accidentally. * The default repository name was changed from /var/lib/backup to /var/lib/pgbackrest. * Lock files are now stored in /tmp/pgbackrest by default. These days /run/pgbackrest would be the preferred location but that would require init scripts which are not part of this release. The lock-path option can be used to configure the lock directory. * Log files are now stored in /var/log/pgbackrest by default and no longer have the date appended so they can be managed with logrotate. The log-path option can be used to configure the lock directory. * Executable filename changed from pg_backrest to pgbackrest.
2016-04-14 15:30:54 +02:00
<text>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.
Since <postgres/> 9.2 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.</text>
<example>ts_01=/db/ts_01</example>
</config-key>
<!-- CONFIG - RESTORE SECTION - TABLESPACE KEY -->
<config-key id="tablespace-map-all" name="Map All Tablespaces">
<summary>Restore all tablespaces into the specified directory.</summary>
<text>By default tablespaces are restored into their original locations and while this behavior can be modified by with the <setting>tablespace-map</setting> open it is sometime 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.
The path specified will be the parent path used to create all the tablespaces in the backup.</text>
<example>/data/tablespace</example>
</config-key>
</config-key-list>
</config-section>
<!-- CONFIG - STANZA -->
<config-section id="stanza" name="Stanza">
<text>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.
<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).</text>
<config-key-list>
<!-- CONFIG - STANZA SECTION - PG-HOST-CMD KEY -->
<config-key id="pg-host-cmd" name="PostgreSQL Host Command">
<summary><backrest/> exe path on the <postgres/> host.</summary>
<text>Required only if the path to <exe/> is different on the local and <postgres/> hosts. If not defined, the database host exe path will be set the same as the local exe path.</text>
<default>same as local</default>
<example>/usr/lib/backrest/bin/pgbackrest</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-HOST-CONFIG KEY -->
<config-key id="pg-host-config" name="PostgreSQL Host Configuration">
<summary><backrest/> database host configuration file.</summary>
<text>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.</text>
<example>/conf/pgbackrest/pgbackrest.conf</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-HOST-CONFIG-INCLUDE-PATH KEY -->
<config-key id="pg-host-config-include-path" name="PostgreSQL Host Configuration Include Path">
<summary><backrest/> database host configuration include path.</summary>
<text>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.</text>
<example>/conf/pgbackrest/conf.d</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-HOST-CONFIG-PATH KEY -->
<config-key id="pg-host-config-path" name="PostgreSQL Host Configuration Path">
<summary><backrest/> database host configuration path.</summary>
<text>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.</text>
<example>/conf/pgbackrest</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-HOST KEY -->
<config-key id="pg-host" name="PostgreSQL Host">
<summary><postgres/> host for operating remotely via SSH.</summary>
<text>Used for backups where the <postgres/> host is different from the repository host.</text>
<example>db.domain.com</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-HOST-USER 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>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.</text>
<example>db_owner</example>
</config-key>
Prepare configuration module for multi-repository support. Refactor the code to allow a dynamic number of indexes for indexed options, e.g. pg-path. Our reliance on getopt_long() still limits the number of indexes we can have per group, but once this limitation is removed the rest of the code should be happy with dynamic numbers of indexes (with a reasonable maximum). Add an option to set a default in each group. This was previously handled by the host-id option but now there is a specific option for each group, pg and repo. These remain internal until they can be fully tested with multi-repo support. They are fully tested for internal usage. Remove the ConfigDefineOption enum and use the ConfigOption enum instead. They are now equal since the indexed options (e.g. cfgOptRepoHost2) have been removed from ConfigOption. Remove the config/config test module and add required tests to the config/parse test module. Parsing is now the only way to load a config so this removes some redundancy. Split new internal config structures and functions into a new header file, config.intern.h. More functions will need to be moved over from config.h but that will need to be done in a future commit to reduce churn. Add repoIdx to repoIsLocal() and storageRepo*(). Multi-repository support requires that repo locality and storage be accessible by index. This allows, for example, multiple repos to be iterated in a loop. This could be done in a separate commit but doesn't seem worth it since the code is related. Remove the type parameter from storageRepoGet(). This parameter existed solely to provide coverage for the case where the storage type was invalid. A better pattern is to check that the type is S3 once all other types have been ruled out.
2020-11-23 22:55:46 +02:00
<!-- ======================================================================================================= -->
<config-key id="pg-database" name="PostgreSQL Database">
<summary><postgres/> database.</summary>
<text>The database name used when connecting to <postgres/>. The default is usually best but some installations may not contain this database.
Note that for legacy reasons the setting of the <id>PGDATABASE</id> environment variable will be ignored.</text>
<example>backupdb</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-PATH KEY -->
<config-key id="pg-path" name="PostgreSQL Path">
<summary><postgres/> data directory.</summary>
<text>This should be the same as the <setting>data_directory</setting> setting in <file>postgresql.conf</file>. Even though this value can be read from <file>postgresql.conf</file> or <postgres/> it is prudent to set it in case those resources are not available during a restore or offline backup scenario.
The <setting>pg-path</setting> option is tested against the value reported by <postgres/> on every online backup so it should always be current.</text>
<example>/data/db</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-PORT KEY -->
<config-key id="pg-port" name="PostgreSQL Port">
<summary><postgres/> port.</summary>
<text>Port that <postgres/> is running on. This usually does not need to be specified as most <postgres/> clusters run on the default port.</text>
<example>6543</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-SOCKET-PATH KEY -->
<config-key id="pg-socket-path" name="PostgreSQL Socket Path">
<summary><postgres/> unix socket path.</summary>
<text>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_directory</setting> setting in <file>postgresql.conf</file>.</text>
<example>/var/run/postgresql</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-USER KEY -->
<config-key id="pg-user" name="PostgreSQL Database User">
<summary><postgres/> database user.</summary>
<text>The database user name used when connecting to <postgres/>. If not specified <backrest/> will connect with the local OS user or <id>PGUSER</id>.</text>
<example>backupuser</example>
</config-key>
<!-- CONFIG - STANZA SECTION - PG-HOST-PORT KEY -->
<config-key id="pg-host-port" name="PostgreSQL Host Port">
<summary><postgres/> host port when <setting>pg-host</setting> is set.</summary>
<text>Use this option to specify a non-default port for the <postgres/> host protocol. Currently only SSH is supported</text>
<example>25</example>
</config-key>
</config-key-list>
</config-section>
</config-section-list>
</config>
<!-- COMMAND -->
<operation title="{[project]} Command Reference">
<description>The {[project]} Command Reference details all commands and options.</description>
<text>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 configured in <file>pgbackrest.conf</file>.
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.
The <id>no-</id> prefix may be used to set a boolean option to false on the command-line.
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 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>.
Command-line options override environment options which override config file options.</text>
<operation-general title="General Options">
<option-list>
<!-- OPERATION - GENERAL - CIPHER-PASS OPTION -->
<option id="cipher-pass" name="Ad Hoc Cipher Passphrase">
<summary>Cipher passphrase for current command.</summary>
<text>Specify an ad hoc cipher passphrase for the current command.
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
<example>zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO</example>
</option>
<!-- OPERATION - GENERAL - CONFIG OPTION -->
<option id="config" name="Config">
<summary><backrest/> configuration file.</summary>
<text>Use this option to specify a different configuration file than the default.</text>
<example>/conf/pgbackrest/pgbackrest.conf</example>
</option>
<!-- OPERATION - GENERAL - CONFIG INCLUDE PATH OPTION -->
<option id="config-include-path" name="Config Include Path">
<summary>Path to additional <backrest/> configuration files.</summary>
<text>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.</text>
<example>/conf/pgbackrest/conf.d</example>
</option>
<!-- OPERATION - GENERAL - CONFIG PATH OPTION -->
<option id="config-path" name="Config Path">
<summary>Base path of <backrest/> configuration files.</summary>
<text>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.
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>.</text>
<example>/conf/pgbackrest</example>
</option>
<!-- OPERATION - GENERAL - DRY-RUN OPTION -->
<option id="dry-run" name="Dry Run">
<summary>Execute a dry-run for the command.</summary>
2020-03-28 23:48:57 +02:00
<text>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.</text>
<example>y</example>
</option>
<!-- OPERATION - GENERAL - RAW -->
<option id="raw" name="Raw Data">
<summary>Do not transform data.</summary>
<text>Do not transform (i.e, encrypt, decompress, etc.) data for the current command.</text>
<example>y</example>
</option>
<!-- =========================================================================================================== -->
<option id="repo" section="repository" name="Set Repository">
<summary>Set repository.</summary>
<text>Set the repository for a command to operate on.
For example, this option may be used to perform a restore from a specific repository, rather than letting <backrest/> choose.</text>
<example>1</example>
</option>
<!-- OPERATION - GENERAL - STANZA OPTION -->
<option id="stanza" name="Stanza">
<summary>Defines the stanza.</summary>
<text>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.
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.</text>
<example>main</example>
</option>
</option-list>
</operation-general>
<command-list title="Commands">
<!-- OPERATION - BACKUP COMMAND -->
<command id="backup" name="Backup">
<summary>Backup a database cluster.</summary>
<text>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.
<backrest/> does not have a built-in scheduler so it's best to run it from cron or some other scheduling mechanism.
See <link page="user-guide" section="/quickstart/perform-backup">Perform a Backup</link> for more details and examples.</text>
<option-list>
<!-- OPERATION - BACKUP COMMAND - TYPE OPTION -->
<option id="type" name="Type">
<summary>Backup type.</summary>
<text>The following backup types are supported:
<ul>
<li><id>full</id> - all database cluster files will be copied and there will be no dependencies on previous backups.</li>
<li><id>incr</id> - incremental from the last successful backup.</li>
<li><id>diff</id> - like an incremental backup but always based on the last full backup.</li>
</ul></text>
<example>full</example>
</option>
<!-- OPERATION - BACKUP COMMAND - FORCE OPTION -->
<option id="force" name="Force">
<summary>Force an offline backup.</summary>
<text>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>
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>postmaster.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.</text>
<example>y</example>
</option>
<!-- ======================================================================================================= -->
<option id="online" name="Online">
<summary>Perform an online backup.</summary>
<text>Specifying --no-online prevents <backrest/> from running <code>pg_start_backup()</code> and <code>pg_stop_backup()</code> 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.
2017-09-01 18:29:34 +02:00
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.</text>
<example>n</example>
</option>
</option-list>
</command>
<!-- OPERATION - ARCHIVE-PUSH COMMAND -->
<command id="archive-push" name="Archive Push">
<summary>Push a WAL segment to the archive.</summary>
<text>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.
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.</text>
</command>
<!-- OPERATION - ARCHIVE-GET COMMAND -->
<command id="archive-get" name="Archive Get">
<summary>Get a WAL segment from the archive.</summary>
<text>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.
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.
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.</text>
</command>
<!-- OPERATION - CHECK COMMAND -->
<command id="check" name="Check">
<summary>Check the configuration.</summary>
<text>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.
2017-09-01 18:29:34 +02:00
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. Restore points are only supported in <postgres/> &gt;= 9.1 so for older versions the <cmd>check</cmd> command may fail if there has been no write activity since the last log rotation, therefore it is recommended that activity be generated by the user if there have been no writes since the last WAL switch before running the <cmd>check</cmd> command.</text>
<!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
</command>
<!-- OPERATION - EXPIRE COMMAND -->
<command id="expire" name="Expire">
<summary>Expire backups that exceed retention.</summary>
2021-02-05 18:48:07 +02:00
<text><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 and Incremental backups are count-based but will always be expired when the backup they depend on is expired. 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. 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.
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.</text>
<option-list>
<!-- OPERATION - EXPIRE COMMAND - SET OPTION -->
<option id="set" name="Set">
<summary>Backup set to expire.</summary>
<text>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. <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 adhoc expiration in order to prevent an unintended expiration of archives.</admonition></text>
<example>20150131-153358F_20150131-153401I</example>
</option>
</option-list>
</command>
<!-- OPERATION - REPO-CREATE COMMAND -->
<command id="repo-create" name="Create Repository">
<summary>Create the repository.</summary>
<text>Create the repository (path, bucket, etc.) on the default repository. 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. If <setting>repo-type=s3</setting> the bucket will be created.
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
</command>
<!-- OPERATION - REPO-GET COMMAND -->
2021-02-05 17:39:03 +02:00
<command id="repo-get" name="Repository Get">
<summary>Get a file from a repository.</summary>
<text>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.
2021-02-05 17:39:03 +02:00
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>.
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.</text>
<option-list>
<!-- OPERATION - REPO-GET COMMAND - IGNORE-MISSING OPTION -->
<option id="ignore-missing" name="Ignore Missing">
<summary>Ignore missing source file.</summary>
<text>Exit with 1 if the source file is missing but don't throw an error.</text>
<example>y</example>
</option>
</option-list>
</command>
<!-- OPERATION - REPO-LS COMMAND -->
2021-02-05 17:07:43 +02:00
<command id="repo-ls" name="Repository List">
<summary>List files in a repository.</summary>
<text>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.
2021-02-05 17:07:43 +02:00
The default text output prints one file name per line. JSON output is available by specifying <br-option>--output=json</br-option>.
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.</text>
<option-list>
<!-- OPERATION - LS COMMAND - FILTER OPTION -->
<option id="filter" name="Filter Output">
<summary>Filter output with a regular expression.</summary>
<text>The filter is applied against the file/path names before they are output.</text>
2021-02-05 17:07:43 +02:00
<example>"(F|D|I)$"</example>
</option>
<!-- OPERATION - LS COMMAND - OUTPUT OPTION -->
<option id="output" name="Output">
<summary>Output format.</summary>
<text>The following output types are supported:
<ul>
<li><id>text</id> - Simple list with one file/link/path name on each line.</li>
<li><id>json</id> - Detailed file/link/path information in JSON format.</li>
2021-02-05 17:07:43 +02:00
</ul>In JSON format the available fields are:
<ul>
<li><id>name</id> - file/link/path name (and partial path when recursing).</li>
<li><id>type</id> - <id>file</id>, <id>path</id>, or <id>link</id>.</li>
<li><id>size</id> - size in bytes (files only).</li>
<li><id>time</id> - time last modified (files only).</li>
<li><id>destination</id> - link destination (links only).</li>
</ul></text>
<example>json</example>
</option>
<!-- OPERATION - LS COMMAND - RECURSE OPTION -->
<option id="recurse" name="Recurse Subpaths">
<summary>Include all subpaths in output.</summary>
<text>All subpaths and their files will be included in the output.</text>
<example>y</example>
</option>
<!-- OPERATION - LS COMMAND - SORT OPTION -->
<option id="sort" name="Sort Output">
<summary>Sort output ascending, descending, or none.</summary>
<text>The following sort types are supported:
<ul>
<li><id>asc</id> - sort ascending.</li>
<li><id>desc</id> - sort descending.</li>
<li><id>none</id> - no sorting.</li>
</ul></text>
<example>desc</example>
</option>
</option-list>
</command>
<!-- OPERATION - REPO-PUT COMMAND -->
<command id="repo-put" name="Repository Put File">
<summary>Put a file in the repository.</summary>
<text>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.
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.
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
</command>
<!-- OPERATION - REPO-RM COMMAND -->
<command id="repo-rm" name="Repository Remove Paths/Files">
<summary>Remove paths/files in the repository.</summary>
<text>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.
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.
<b>FOR INTERNAL USE ONLY. DO NOT USE ON A PRODUCTION REPOSITORY.</b></text>
<option-list>
<!-- OPERATION - REPO-RM COMMAND - RECURSE OPTION -->
<option id="recurse" name="Recurse Subpaths">
<summary>Remove all sub file/paths.</summary>
<text>All subpaths and their files will be removed.</text>
<example>y</example>
</option>
</option-list>
</command>
<!-- OPERATION - RESTORE COMMAND -->
<command id="restore" name="Restore">
<summary>Restore a database cluster.</summary>
<text>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.
For PITR, <br-option>{[dash]}-type=time</br-option> must be provided and the target time 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. If no backup can be found, the latest backup from the first repository containing backups will be used. See <link page="user-guide" section="/pitr">Point-in-Time Recovery</link> for more details and examples.</text>
<option-list>
<!-- OPERATION - RESTORE COMMAND - SET OPTION -->
<option id="set" name="Set">
<summary>Backup set to restore.</summary>
<text>The backup set to be restored. <id>latest</id> will restore the latest backup, otherwise provide the name of the backup to restore.</text>
<example>20150131-153358F_20150131-153401I</example>
</option>
<!-- OPERATION - RESTORE COMMAND - FORCE OPTION -->
<option id="force" name="Force">
<summary>Force a restore.</summary>
<text>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.</text>
<example>y</example>
</option>
<!-- OPERATION - RESTORE COMMAND - TYPE OPTION -->
<option id="type" name="Type">
<summary>Recovery type.</summary>
<text>The following recovery types are supported:
<ul>
<li><id>default</id> - recover to the end of the archive stream.</li>
<li><id>immediate</id> - recover only until the database becomes consistent. This option is only supported on <postgres/> &gt;= 9.4.</li>
<li><id>name</id> - recover the restore point specified in <br-option>--target</br-option>.</li>
<li><id>xid</id> - recover to the transaction id specified in <br-option>--target</br-option>.</li>
<li><id>time</id> - recover to the time specified in <br-option>--target</br-option>.</li>
<li><id>preserve</id> - preserve the existing <file>recovery.conf</file> file.</li>
<li><id>standby</id> - add <setting>standby_mode=on</setting> to <file>recovery.conf</file> file so cluster will start in standby mode.</li>
2017-09-01 18:29:34 +02:00
<li><id>none</id> - no <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.</li>
</ul></text>
<example>xid</example>
</option>
<!-- OPERATION - RESTORE COMMAND - TARGET OPTION -->
<option id="target" name="Target">
<summary>Recovery target.</summary>
<text>Defines the recovery target when <br-option>--type</br-option> is <id>name</id>, <id>xid</id>, or <id>time</id>.</text>
<example>2015-01-30 14:15:11 EST</example>
</option>
<!-- OPERATION - RESTORE COMMAND - TARGET-EXCLUSIVE OPTION -->
<option id="target-exclusive" name="Target Exclusive">
<summary>Stop just before the recovery target is reached.</summary>
<text>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>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.</text>
<example>n</example>
</option>
<!-- OPERATION - RESTORE COMMAND - TARGET-RESUME OPTION -->
<option id="target-action" name="Target Action">
<summary>Action to take when recovery target is reached.</summary>
<text>This option is effective when <setting>hot_standby=on</setting> is configured in <file>postgresql.conf</file>, otherwise the cluster will be promoted when the target is reached or there is no more WAL in the archive.
The following actions are supported:
<ul>
<li><id>pause</id> - pause when recovery target is reached. (<postgres/> &gt;= 9.1)</li>
<li><id>promote</id> - promote and switch timeline when recovery target is reached. (<postgres/> &gt;= 9.1)</li>
<li><id>shutdown</id> - shutdown server when recovery target is reached. (<postgres/> &gt;= 9.5)</li>
</ul></text>
<example>promote</example>
</option>
<!-- OPERATION - RESTORE COMMAND - TARGET-TIMELINE OPTION -->
<option id="target-timeline" name="Target Timeline">
<summary>Recover along a timeline.</summary>
<text>See <setting>recovery_target_timeline</setting> in the <postgres/> docs for more information.</text>
<example>3</example>
</option>
</option-list>
</command>
<!-- OPERATION - INFO COMMAND -->
<command id="info" name="Info">
<summary>Retrieve information about backups.</summary>
<text>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.
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.
Improve info command fault tolerance. This improvement reduces the number of errors thrown; these errors will now be reported as a status for the stanza or repo as appropriate. Invalid option configurations are still thrown but all other errors are caught, formatted and reported. This was necessary for multiple repositories so that the command can complete gathering information from each repository and report the results rather than immediately aborting when an error occurs. Two new error codes were introduced: 6 = requested backup not found 99 = other, which is used to indicate an error has occurred that requires more details to be provided A new stanza name of "[invalid]" was created for instances where a stanza was not specified and no stanza can be found. If there is only one repository configured the error will move up to the stanza level with the standard error formatting of 'error (message)' where the message will be "other" and the details of the error will be listed on the next line(s): stanza: stanza1 status: error (other) [CryptoError] unable to load info file '/var/lib/pgbackrest/repo/backup/stanza1/backup.info' or '/var/lib/pgbackrest/repo/backup/stanza1/backup.info.copy': CryptoError: cipher header invalid HINT: is or was the repo encrypted? FileMissingError: unable to open missing file '/var/lib/pgbackrest/repo/backup/stanza1/backup.info.copy' for read HINT: backup.info cannot be opened and is required to perform a backup. HINT: has a stanza-create been performed? HINT: use option --stanza if encryption settings are different for the stanza than the global cipher: aes-256-cbc If a backup set is requested but is not found on any repo, a stanza-level status error of 'requested backup not found' is reported when there are no other errors: pgbackrest info --stanza=demo --set=bogus stanza: demo status: error (requested backup not found) cipher: mixed repo1: aes-256-cbc repo2: none If there are multiple repositories configured and a single repo is in error but the other repos are ok or have a different error: pgbackrest info --stanza=demo --set=20210322-171211F stanza: demo status: mixed repo1: error [CryptoError] unable to load info file '/var/lib/pgbackrest/repo/backup/stanza1/backup.info' or '/var/lib/pgbackrest/repo/backup/stanza1/backup.info.copy': CryptoError: cipher header invalid HINT: is or was the repo encrypted? FileMissingError: unable to open missing file '/var/lib/pgbackrest/repo/backup/stanza1/backup.info.copy' for read HINT: backup.info cannot be opened and is required to perform a backup. HINT: has a stanza-create been performed? HINT: use option --stanza if encryption settings are different for the stanza than the global repo2: ok cipher: mixed repo1: aes-256-cbc repo2: none db (current) wal archive min/max (12): 000000010000000000000001/000000010000000000000003 full backup: 20210322-171211F timestamp start/stop: 2021-03-22 17:12:11 / 2021-03-22 17:12:28 wal start/stop: 000000010000000000000002 / 000000010000000000000002 database size: 23.4MB, database backup size: 23.4MB repo2: backup set size: 2.8MB, backup size: 2.8MB database list: postgres (13359) Json output will include the repository information and any error information. If no stanzas are found, then [invalid] will be set as the name: [ { "archive":[], "backup":[], "cipher":"none", "db":[], "name":"[invalid]", "repo":[ { "cipher":"none", "key":1, "status":{ "code":99, "message":"[PathOpenError] unable to list file info for path '/var/lib/pgbackrest/repo2/backup': [13] Permission denied" } } ], "status":{ "code":99, "lock":{"backup":{"held":false}}, "message":"other" } } ]
2021-03-25 18:29:36 +02:00
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.
The '<id>backup/expire running</id>' message will appear beside the '<id>status</id>' information if one of those commands is currently running on the host.
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>).
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.
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.
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).
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/> or the filesystem.
The '<id>backup reference list</id>' contains the additional backups that are required to restore this backup.</text>
<!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
<option-list>
<!-- OPERATION - INFO COMMAND - OUTPUT OPTION -->
<option id="output" name="Output">
<summary>Output format.</summary>
<text>The following output types are supported:
<ul>
<li><id>text</id> - Human-readable summary of backup information.</li>
<li><id>json</id> - Exhaustive machine-readable backup information in JSON format.</li>
</ul></text>
<example>json</example>
</option>
<option id="set" name="Set">
<summary>Backup set to detail.</summary>
<text>Details include 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.</text>
<example>20150131-153358F_20150131-153401I</example>
</option>
</option-list>
</command>
<!-- OPERATION - HELP COMMAND -->
<command id="help" name="Help">
<summary>Get help.</summary>
<text>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.</text>
</command>
<!-- OPERATION - START COMMAND -->
<command id="start" name="Start">
<summary>Allow <backrest/> processes to run.</summary>
<text>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.</text>
</command>
<!-- OPERATION - STOP COMMAND -->
<command id="stop" name="Stop">
<summary>Stop <backrest/> processes from running.</summary>
<text>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.
<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.</text>
<option-list>
<!-- OPERATION - STOP COMMAND - FORCE OPTION -->
<option id="force" name="Force">
<summary>Force all <backrest/> processes to stop.</summary>
<text>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.</text>
<example>y</example>
</option>
</option-list>
</command>
<!-- OPERATION - VERIFY COMMAND -->
<command id="verify" name="Verify">
<summary>Verify the contents of the repository.</summary>
<text>Verify will attempt to determine if the backups and archives in the repository are valid.</text>
<option-list>
<!-- OPERATION - VERIFY COMMAND - SET OPTION -->
<option id="set" name="Set">
<summary>Backup set to verify.</summary>
<text>Verify all database and archive files associated with the specified backup set.</text>
<example>20150131-153358F_20150131-153401I</example>
</option>
</option-list>
</command>
<!-- OPERATION - VERSION COMMAND -->
<command id="version" name="Version">
<summary>Get version.</summary>
<text>Displays installed <backrest/> version.</text>
</command>
<!-- OPERATION - STANZA-CREATE COMMAND -->
<command id="stanza-create" name="Stanza Create">
<summary>Create the required stanza data.</summary>
<text>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. See <link page="user-guide" section="/quickstart/create-stanza">Create the Stanza</link> for more information and an example.</text>
<option-list>
<!-- OPERATION - STANZA-CREATE COMMAND - FORCE OPTION -->
<option id="force" name="Force">
<summary>Force stanza creation.</summary>
<text>This option is no longer supported.</text>
<example>n</example>
</option>
<!-- ======================================================================================================= -->
<option id="online" name="Online">
<summary>Create on an online cluster.</summary>
<text>Specifying --no-online prevents <backrest/> from connecting to <postgres/> when creating the stanza.</text>
<example>n</example>
</option>
</option-list>
</command>
<!-- OPERATION - STANZA-UPGRADE COMMAND -->
<command id="stanza-upgrade" name="Stanza Upgrade">
<summary>Upgrade a stanza.</summary>
<text>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 created on each. If the database is offline use the <br-option>--no-online</br-option> option.</text>
<!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
<option-list>
<!-- ======================================================================================================= -->
<option id="online" name="Online">
<summary>Update an online cluster.</summary>
<text>Specifying --no-online prevents <backrest/> from connecting to <postgres/> when upgrading the stanza.</text>
<example>n</example>
</option>
</option-list>
</command>
<!-- OPERATION - STANZA-DELETE COMMAND -->
<command id="stanza-delete" name="Stanza Delete">
<summary>Delete a stanza.</summary>
<text>The <cmd>stanza-delete</cmd> command removes data in the repository associated with a stanza.<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>
To delete a stanza:
<ul>
<li>Shut down the <postgres/> cluster associated with the stanza (or use --force to override).</li>
<li>Run the <cmd>stop</cmd> command on the host where the <cmd>stanza-delete</cmd> command will be run.</li>
<li>Run the <cmd>stanza-delete</cmd> command.</li>
</ul>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.
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.</text>
<!-- Note, linking to the User Guide is limited since it can cause a cyclical reference -->
<option-list>
<!-- OPERATION - STANZA-CREATE COMMAND - FORCE OPTION -->
<option id="force" name="Force">
<summary>Force stanza delete.</summary>
<text>If <postgres/> is still running for the stanza, then this option can be used to force the stanza to be deleted from the repository.</text>
<example>n</example>
</option>
</option-list>
</command>
</command-list>
</operation>
</doc>