BARMAN(1)
๐ธ BARMAN โ barman Commands ๐
okay bestie so like. barman is a command-line interface named barman, and honestly? it's the main character of the whole Barman situation โ you use it basically to interact with Barman's backend. no cap.
but before we dive into each and every sub-command (and there are so many, we're getting there), you need to know that barman has global options that work for all of the sub-commands. they change how the sub-commands behave, and you use them like this:
๐ BARMAN
โจ Synopsis
barman
[ { -c | --config } CONFIG ]
[ { --color | --colour } { never | always | auto } ]
[ { -d | --debug } ]
[ { -f | --format } { json | console } ]
[ { -h | --help } ]
[ --log-level { NOTSET | DEBUG | INFO | WARNING | ERROR | CRITICAL } ]
[ { -q | --quiet } ]
[ { -v | --version } ]
[ SUBCOMMAND ]
Note: so this is how you read the synopsis syntax, bestie โ memorize it, it comes back <em>everywhere</em>: - Options between square brackets are optional โ you can skip them, it's fine. - Options between curly brackets represent a choose one of set operation โ pick exactly one, no collecting them all. - Options with[ ... ]can be specified multiple times. - Things written in UPPERCASE represent a literal that should be given a value to. We're gonna use this exact same syntax when describing the barman sub-commands in the following sections, so like. keep it in your pocket. ๐ Also โ when describing sub-commands in the following sections, the commands' synopsis should be seen as a replacement for theSUBCOMMANDslot. slay.
๐ง Parameters
-c/--configCONFIG โ specify the configuration file to be used. Defaults to/etc/barman.confif not provided. it's giving "I know where I live" energy.--color/--colour{ never | always | auto } โ control whether to use colors in the output. The default isauto. Options are:never: Do not use color.always: Always use color.auto: Use color if the output is to a terminal.
-d/--debugโ enable debug output. Default isfalse. Provides detailed logging information for troubleshooting. like turning the lights all the way up. ๐ฅ-f/--format{ json | console } โ specify the output format. Options are:json: Output in JSON format.console: Output in human-readable format (default).
-h/--helpโ show a help message and exit. Provides information about command usage. bestie behavior honestly ๐ซถ--log-level{ NOTSET | DEBUG | INFO | WARNING | ERROR | CRITICAL } โ override the default logging level. Options are:NOTSET: This is the default level when no specific logging level is set. It essentially means "no filtering" of log messages, allowing all messages to be processed according to the levels that are set in the configuration.DEBUG: This level is used for detailed, diagnostic information, often useful for developers when diagnosing problems. It includes messages that are more granular and detailed, intended to help trace the execution of the program.INFO: This level provides general information about the application's normal operation. It's used for messages that indicate the progress of the application or highlight key points in the execution flow that are useful but not indicative of any issues.WARNING: This level indicates that something unexpected happened or that there might be a potential problem. It's used for messages that are not critical but could be of concern, signaling that attention might be needed.ERROR: This level is used when an error occurs that prevents a particular operation from completing successfully. It's used to indicate significant issues that need to be addressed but do not necessarily stop the application from running.CRITICAL: This is the highest level of severity, indicating a serious error that has likely caused the application to terminate or will have severe consequences if not addressed immediately. It's used for critical issues that demand urgent attention. ๐
-q/--quietโ suppress all output. Useful for cron jobs or automated scripts. shhh. ๐คซ-v/--versionโ show the program version number and exit.
๐ SHORTCUTS
For some commands, you can use the following shortcuts or aliases to identify a backup for a given server. Specifically, the all shortcut can be used to identify all servers:
allโ All available serversfirst/oldestโ Oldest available backup for the server, in chronological order.last/latestโ Most recent available backup for the server, in chronological order.last-full/latest-fullโ Most recent full backup taken with methodsrsyncorpostgres.last-failedโ Most recent backup that failed, in chronological order.
๐ EXIT STATUSES
Status code 0 means success, while status code Non-Zero means failure. that's it, that's the whole vibe check. โ
/ โ
๐ SUB-COMMANDS
barman exposes several handy operations. This section is intended to describe each of them.
In the following sections you can find a description of each command implemented by barman. Some of these commands may have more detailed information in another main section in this documentation. If that is the case, a reference is provided to help you quickly navigate to it. iykyk ๐
๐ง barman archive-wal
Synopsis
archive-wal
[ { -h | --help } ]
SERVER_NAME
Description
Fetch WAL files received from either the standard archive_command or streaming replication with pg_receivewal and store them in the server's WAL archive. If you have enabled compression in the configuration file, the WAL files will be compressed before they are archived. lowkey elegant.
Parameters
SERVER_NAMEโ Name of the server in barman node.-h/--helpโ show a help message and exit. Provides information about command usage.
๐ฅ barman backup
Synopsis
backup
[ --bwlimit KBPS ]
[ --cloud-staging-directory PATH ]
[ --cloud-staging-max-size SIZE ]
[ { -h | --help } ]
[ --incremental BACKUP_ID ]
[ --immediate-checkpoint ]
[ { -j | --jobs } PARALLEL_WORKERS ]
[ --jobs-start-batch-period PERIOD ]
[ --jobs-start-batch-size SIZE ]
[ --keepalive-interval SECONDS ]
[ --manifest ]
[ --name NAME ]
[ --no-immediate-checkpoint ]
[ --no-manifest ]
[ --no-retry ]
[ --retry-sleep SECONDS ]
[ --retry-times NUMBER ]
[ --reuse-backup { off | copy | link } ]
[ { --wait | -w } ]
[ --wait-timeout SECONDS ]
SERVER_NAME [ SERVER_NAME ... ]
Description
Execute a PostreSQL server backup. Barman will use the parameters specified in the Global and Server configuration files. Specify the all shortcut instead of the server name to execute backups from all servers configured in the Barman node. You can also specify multiple server names in sequence to execute backups for specific servers. go off, queen ๐
Parameters
SERVER_NAMEโ Name of the server in barman node.--bwlimitโ specify the maximum transfer rate in kilobytes per second. A value of0indicates no limit. This setting overrides thebandwidth_limitconfiguration option.--cloud-staging-directoryโ a staging directory for when sending backups to a cloud object storage usingbackup_method = postgres. It is used as a temporary location for storing chunks of the backup before they are sent to the cloud. Defaults to/tmp/barman/cloud-staging.--cloud-staging-max-sizeโ the maximum size that--cloud-staging-directorycan grow to before Barman stops generating new backup chunks. This is used to prevent the staging directory from growing in case the speed of uploading chunks does not keep up with the speed of streaming them from Postgres. The default value is30Gi.
Extremely low values are discouraged as they may lead to performance degradation. We recommend a minimum of at least 10Gi. The optimal value will depend on the transfer speed of the backup to Barman and from Barman to the cloud, as well as the size of the backup.
The accepted format is n{k|Ki|M|Mi|G|Gi|T|Ti} and case-sensitive, where n is an integer greater than zero, with an optional SI or IEC suffix. k stands for kilo with k = 1000, while Ki stands for kilobytes Ki = 1024. The rest of the options have the same reasoning for greater units of measure.
-h/--helpโ show a help message and exit. Provides information about command usage.--incrementalโ execute a block-level incremental backup. You must provide aBACKUP_IDor a shortcut to a previous backup, which will serve as the parent backup for the incremental backup.
Note: The backup to be and the parent backup must have backup_method=postgres. non-negotiable, bestie.
--immediate-checkpointโ bestie, this one forces the initial checkpoint to happen ASAP, overriding whateverimmediate_checkpointparameter you set in the config file. It's giving "we're not waiting around" energy. ๐-j/--jobsโ tells Barman how many parallel workers to use for copying files during the backup. This overrides theparallel_jobsparameter if you've got it set in the configuration file. More workers = more hands on deck ๐ซถ--jobs-start-batch-periodโ sets the time period, in seconds, for starting a single batch of jobs. This value overrides theparallel_jobs_start_batch_periodparameter if it's set in the configuration file. The default is 1 second.--jobs-start-batch-sizeโ sets the maximum number of parallel workers to kick off in a single batch. Overrides theparallel_jobs_start_batch_sizeparameter if it's defined in the configuration file. The default is 10 workers.--keepalive-intervalโ the interval, in seconds, for sending a heartbeat query to the server so the libpq connection stays active during a Rsync backup. The default is 60 seconds. Set it to 0 and the heartbeat is disabled, periodt.--manifestโ forces a backup manifest file to be created once a backup completes. Overrides theautogenerate_manifestparameter from the configuration file. Heads up: this only applies to the rsync backup strategy. ๐--nameโ give this backup a cute friendly name ๐ which you can then use in place of the backup ID inbarmancommands.--no-immediate-checkpointโ forces the backup to wait for the checkpoint to be executed, overriding whatever value you set for theimmediate_checkpointparameter in the configuration file. The opposite twin of--immediate-checkpoint, iykyk.--no-manifestโ disables the automatic creation of a backup manifest file when a backup completes. Overrides theautogenerate_manifestparameter from the configuration file, and applies only to the rsync backup strategy.--no-retryโ no retries if there's an error. Literally the same as setting--retry-times 0. ๐--retry-sleepโ how many seconds to wait after a failed copy before retrying. This applies to both backup and recovery operations, and overrides thebasebackup_retry_sleepparameter if it's defined in the configuration file.--retry-timesโ how many times to retry the base backup copy if there's an error. Applies to both backup and recovery operations, and overrides thebasebackup_retry_timesparameter if it's set in the configuration file.--reuse-backupโ overrides the behavior of thereuse_backupoption you configured in the configuration file. The possible values are:off: do not reuse the last available backup.copy: reuse the last available backup for a server and create copies of unchanged files (this reduces backup time).link(default): reuse the last available backup for a server and create hard links to unchanged files (saves both backup time and space). ๐
Note: this will only have any effect if the last available backup was executed with backup_method=rsync. No cap.
--wait/-wโ wait for all the necessary WAL files required by the base backup to be archived. โณ--wait-timeoutโ how long, in seconds, to wait for the required WAL files to be archived before timing out.
โจ Shortcuts โจ
Use shortcuts instead of SERVER_NAME:
allโ All available servers ๐ธ
๐ฆ barman check-archived-wal-range ๐ฆ
Synopsis
check-archived-wal-range
[ { -h | --help } ]
SERVER_NAME BEGIN_WAL END_WAL
Description
Checks that every single WAL segment in the range from BEGIN_WAL to END_WAL (inclusive, bestie โ both ends count) is present in the WAL archive of the specified server. If any segments are missing, they get listed and the command exits with a non-zero status. Exits with status 0 when the sequence is complete. โ
This command scans the WAL archive directory directly, so it's reflecting the actual state of the storage, not Barman's internal index. It's giving honest-to-a-fault energy, and we love that. ๐
Parameters
SERVER_NAMEโ Name of the server in barman node.BEGIN_WALโ Name of the first WAL segment in the range to verify (inclusive).END_WALโ Name of the last WAL segment in the range to verify (inclusive).-h/--helpโ Show a help message and exit. Provides information about command usage.
๐ barman check-backup ๐
Synopsis
check-backup
[ { -h | --help } ]
SERVER_NAME BACKUP_ID
Description
Checks that all the necessary WAL files for verifying the consistency of a physical backup are properly archived. This command runs automatically via the cron job and at the end of every backup operation. Oh, and you can use a shortcut instead of BACKUP_ID โ details below, bestie. ๐
Parameters
SERVER_NAMEโ Name of the server in barman node.BACKUP_IDโ Id of the backup in barman catalog.-h/--helpโ Show a help message and exit. Provides information about command usage.
โจ Shortcuts โจ
Use shortcuts instead of BACKUP_ID:
first/oldestโ Oldest available backup for the server, in chronological order. ๐ฐ๏ธlast/latestโ Most recent available backup for the server, in chronological order. โจlast-full/latest-fullโ Most recent full backup taken with methodsrsyncorpostgres.last-failedโ Most recent backup that failed, in chronological order. ๐
๐ barman check ๐
Synopsis
check
[ { -h | --help } ]
[ --nagios ]
SERVER_NAME [ SERVER_NAME ... ]
Description
Displays status information about a server โ SSH connection, Postgres version, configuration and backup directories, archiving and streaming processes, replication slots, and more. It's the vibe check for your whole setup, fr fr. ๐
Use all as a shortcut to show diagnostic information for every configured server.
Parameters
SERVER_NAMEโ Name of the server in barman node.-h/--helpโ Show a help message and exit. Provides information about command usage.--nagiosโ Nagios plugin compatible output. ๐
โจ Shortcuts โจ
Use shortcuts instead of SERVER_NAME:
allโ All available servers ๐ธ
โ๏ธ barman cloud-wal-archive โ๏ธ
Synopsis
cloud-wal-archive
[ { -h | --help } ]
[ { -p | --parallel } PARALLEL ]
SERVER_NAME WAL_PATH
Description
Pushes a WAL file from the local disk up to a configured cloud object storage. This command is meant to be used in the archive_command of a Postgres server when you're using the local-to-cloud backup method for taking base backups. ๐
Note: the compression algorithm and level used for the WAL files can be configured in the Barman server configuration file. If you don't specify anything, the WAL file gets uploaded with no compression at all.
Parameters
SERVER_NAMEโ The name of the Postgres server for which the WAL file is being archived.WAL_PATHโ The value of the%pkeyword (according toarchive_command).-h/--helpโ Show a help message and exit. Provides information about command usage.-p/--parallelโ Number of WALs to archive in parallel. When you set this to a value greater than1, up toparallel - 1additional WAL files that are ready inpg_wal/archive_statusget uploaded concurrently in background processes after the primary WAL has been successfully archived. This can reduce the WAL archival backlog during periods of high WAL generation. Defaults to thecloud_wal_archive_parallelserver configuration value, which itself defaults to0(disabled). ๐ฆ
๐ง barman cloud-wal-restore ๐ง
Synopsis
cloud-wal-restore
[ { -h | --help } ]
[ { -p | --parallel } PARALLEL ]
[ --spool-dir SPOOL_DIR ]
SERVER_NAME WAL_NAME WAL_DEST
Description
Pulls a WAL file from a configured cloud object storage back down to the local disk. This command is meant to be used as restore_command in Postgres when you're restoring WALs from a cloud object storage. ๐ซ
This command requires the server to have cloud storage configured via wals_directory pointing to a cloud URL (e.g., s3://barman/wals).
Parameters ๐ง
SERVER_NAMEโ the name of the Postgres server whose WAL file is getting restored. Like, which server, bestie, we need the deets.WAL_NAMEโ the value of the%fkeyword (perrestore_command). Yes, that%f.WAL_DESTโ the value of the%pkeyword (perrestore_command).-h/--helpโ show a help message and dip. โจ-p/--parallelโ how many WAL files to peek and download in parallel. Set it above1and it fetches the WAL file you asked for plus the nextN - 1files at the same time. Those extra files get staged in the spool directory so the next restore requests can be served immediately from local storage. Default is0(disabled). Very demure, very mindful, very off by default.--spool-dirโ the directory used to stage those extra WALs when you're using--parallel. Default is/var/tmp/walrestore.
๐ก Tip: when you use--paralleland both thepg_waldirectory and the spool directory live on the same filesystem, WAL files get served faster โ because they're renamed instead of copied. Cheaper, quicker, iconic.
barman config-switch ๐
Synopsis
config-switch
[ { -h | --help } ]
SERVER_NAME { --reset | MODEL_NAME }
Description
Applies a set of configuration overrides from the model onto a server in Barman. The final config will combine โ or override โ the server's existing settings with the ones you specified in the model. And if you ever want to undo the whole thing, you can reset the server configurations with the --reset argument. Clean slate energy. ๐งผ
๐ Note: only one model can be active at a time for a given server. That's it. One. Pick your fave.
Parameters
SERVER_NAMEโ name of the server in barman node.MODEL_NAMEโ name of the model.-h/--helpโ show a help message and exit. Gives you the info about command usage.--resetโ reset the server's configurations.
barman config-update ๐
Synopsis
config-update
[ { -h | --help } ]
STRING
Description
Creates or updates the configurations for servers and/or models in Barman. The parameter has to be a JSON string containing an array of documents. Every document must include a scope key โ which can be either server or model โ plus either a server_name or a model_name key, depending on what the scope value is. On top of that, the document should include the other keys representing Barman configuration options and the values you want them to have.
โ ๏ธ Note: thebarman config-updatecommand writes configuration options to a file named.barman.auto.conf, located in thebarman_homedirectory. This configuration file has higher precedence and will override values from the global Barman configuration file (usually/etc/barman.conf) and from any included files specified inconfiguration_files_directory(typically files in/etc/barman.d). So likeโฆ be aware of this if you decide to manually modify configuration options in those files later. It will absolutely win the argument. ๐ญ
Parameters
STRINGโ list of JSON formatted string.-h/--helpโ show a help message and exit. Gives you the info about command usage.
Example
JSON_STRING='[{โscopeโ: โserverโ, โserver_nameโ: โmy_serverโ,
โarchiverโ: โonโ, โstreaming_archiverโ: โoffโ}]'
barman cron ๐ธ
Synopsis
cron
[ { -h | --help } ]
[ --keep-descriptors ]
Description
Carries out the maintenance tasks โ think enforcing retention policies, managing WAL files, all that unglamorous but absolutely necessary backstage work. The main character is not on stage but she is running the show. ๐
Parameters
-h/--helpโ show a help message and exit. Gives you the info about command usage.--keep-descriptorsโ keeps thestdoutandstderrstreams of the Barman subprocesses connected to the main process. This is especially useful for Docker-based installations. ๐ณ
barman delete ๐
Synopsis
delete
[ { -h | --help } ]
SERVER_NAME BACKUP_ID
Description
Deletes the specified backup. And yes, you can use a shortcut instead of BACKUP_ID โ see below, bestie, we got you.
Parameters
SERVER_NAMEโ name of the server in barman node.BACKUP_IDโ id of the backup in barman catalog.-h/--helpโ show a help message and exit. Gives you the info about command usage.
Shortcuts โ๏ธ
Use these instead of BACKUP_ID:
first/oldestโ oldest available backup for the server, in chronological order.last/latestโ most recent available backup for the server, in chronological order.last-full/latest-fullโ most recent full backup taken with methodsrsyncorpostgres.last-failedโ most recent backup that failed, in chronological order.
barman diagnose ๐ฉบ
Synopsis
diagnose
[ { -h | --help } ]
[ --show-config-source ]
Description
Displays diagnostic information about the Barman node โ that's the server where Barman is installed โ plus all the configured Postgres servers. The receipts include things like global configuration, SSH version, Python version, rsync version, the current configuration and status of all servers, and many more. It's giving full-body scan for your setup. ๐
Parameters
-h/--helpโ show a help message and exit. Gives you the info about command usage.--show-config-sourceโ include the source file which provides the effective value for each configuration option. So you know exactly where a setting came from. No more "who set this??" mysteries. ๐ต๏ธ
barman export-backup ๐ฆ
Synopsis
export-backup
[ { -h | --help } ]
[ --compression { gzip | bzip2 | xz } ]
[ --compression-level COMPRESSION_LEVEL ]
SERVER_NAME BACKUP_ID OUTPUT_DIRECTORY
Description
Exports the specified backup as a single tarball, suitable for hand-off to an external archival system. The tarball is self-contained: it bundles the backup data files, any tablespaces, the WAL segments required to bring the backup to a consistent state, and the Barman metadata needed to re-register the backup with barman import-backup later. Everything in one bag. ๐โจ
The generated file is named using the pattern backup-export-SERVER_NAME-BACKUP_ID-TIMESTAMP-CHECKSUM.tar[.gz|.bz2|.xz].
โ ๏ธ The filename is part of the integrity contract โ do not rename the tarball, or barman import-backup will refuse it. Not "might", will. Respect the name, fr fr.
Only full backups in DONE state on a server using local storage can be exported. See Backup export and import for the full feature description.
Parameters
SERVER_NAMEโ name of the server in barman node.BACKUP_IDโ id of the backup in barman catalog.OUTPUT_DIRECTORYโ existing directory where the exported tarball will be written. Must be writable and executable by the user running Barman. ๐--compression {gzip | bzip2 | xz}โ compress the outer tarball using the given algorithm. By default the tarball is not compressed. Heads up: compression applies only to the outer tarball โ data files and WAL segments stored inside are not recompressed, and any pre-existing WAL compression is preserved through the associatedxlog.dbmetadata.--compression-level COMPRESSION_LEVELโ compression level to pass to the chosen algorithm. Valid levels are1-9forgzipandbzip2, and0-9forxz. Defaults to the algorithm's own default level. Requires--compressionto be set.
๐ Note: passing an explicit--compression-levelrequires Python 3.12 or newer forgzip/bzip2and Python 3.14 or newer forxz. On older interpreters the option is accepted, a warning is emitted, and the algorithm's default level is used instead. So it won't crash โ it'll just side-eye you and do its own thing. ๐
barman generate-manifest ๐งพ
Synopsis
generate-manifest
[ { -h | --help } ]
SERVER_NAME BACKUP_ID
Description
Generates a backup_manifest file for a backup. And yes, you can use a shortcut instead of BACKUP_ID. โจ
Parameters
SERVER_NAMEโ name of the server in barman node.BACKUP_IDโ id of the backup in barman catalog.-h/--helpโ show a help message and exit. Gives you the info about command usage.
Shortcuts ๐ซ
Bestie, when a command wants a BACKUP_ID, you can slide in one of these little magic words instead ๐
first/oldestโ the oldest available backup for the server, in chronological order. like, the grandma of the backup fam ๐ตlast/latestโ the most recent available backup for the server, in chronological order. the baby of the fam ๐ผlast-full/latest-fullโ the most recent full backup taken with methodsrsyncorpostgres.last-failedโ the most recent backup that failed, in chronological order. ๐ญ
barman get-wal
Synopsis
get-wal
[ { --bzip | -j } ]
[ { --gzip | -z | -x } ]
[ { -h | --help } ]
[ --keep-compression ]
[ { --output-directory | -o } OUTPUT_DIRECTORY ]
[ { --peek | -p } VALUE ]
[ { -P | --partial } ]
[ { -t | --test } ]
SERVER_NAME WAL_NAME
Description
Grab a WAL file out of the xlog archive of a server you name. By default, if the WAL file you asked for is actually there, it comes back to you as uncompressed content on STDOUT. โจ
Parameters
SERVER_NAMEโ Name of the server in barman nodeWAL_NAMEโ Id of the backup in barman catalog.--bzip2/-jโ Output will be compressed usingbzip2.--gzip/-z/-xโ Output will be compressed usinggzip.-h/--helpโ Show a help message and exit. Provides information about command usage.--keep-compressionโ Do not decompress the file content. The output will be the original compressed file.--output-directory/-oโ Destination directory where barman will store the WAL file.--peek/-pโ Specify an integer value greater than or equal to1to retrieve WAL files from the specified WAL file up to the value specified by this parameter. When using this option,get-walreturns a list of zero to the specified WAL segment names, with one name per row.-P/--partialโ Additionally, collect partial WAL files (.partial).-t/--testโ Test both the connection and configuration of the specified Postgres server in Barman for WAL retrieval. When this option is used, the requiredWAL_NAMEargument is disregarded.
โ ๏ธ WARNING:-z/--gzipand-j/--bzip2options are deprecated and will be removed in the future. For WAL compression, please make sure to enable it directly on the Barman server via thecompressionconfiguration option. ๐จ
barman import-backup
Synopsis
import-backup
[ { -h | --help } ]
SERVER_NAME INPUT_TARBALL
Description
Register a previously exported backup tarball back into the Barman catalog of SERVER_NAME. The tarball is expected to be the output of barman export-backup (or a file restored to disk verbatim by an external archival system from such an export). After a successful import, the backup is fully usable: it appears in barman list-backups, its metadata is available via barman show-backup, and it can be restored with barman restore. ๐
Imported backups are automatically protected from retention by applying the KEEP:STANDALONE annotation (see barman keep). If you want the imported backup to participate in retention again, remove the annotation explicitly.
Import is performed atomically: the tarball is extracted into a staging directory under basebackups_directory, verified end-to-end, and only then moved into place. If any step fails, the staging area is cleaned up and the catalog and WAL archive are left untouched. See this section Backup export and import for the full feature description. ๐ฆ
Parameters
SERVER_NAMEโ Name of the server in barman node.INPUT_TARBALLโ Path to the export tarball to import.
barman keep
Synopsis
keep
[ { -h | --help } ]
{ { -r | --release } | { -s | --status } | --target { full | standalone } }
SERVER_NAME BACKUP_ID
Description
Mark the specified backup with a target as an archival backup to be retained indefinitely, overriding any active retention policies. You can also check the keep status of a backup and release the keep mark from a backup. You can use a shortcut instead of BACKUP_ID. ๐
๐ NOTE: Incremental backups are not eligible for thekeepcommand. This restriction exists because incremental backups rely on their parent backups and cannot be used on their own for recovery. Keeping an incremental without its base would serve no purpose, as it is unusable independently. If you attempt to applykeepto an incremental backup, Barman will return an error indicating that incremental backups cannot be kept. Only the full base backup โthe one that starts the backup chainโ can be marked withkeep.
Parameters
SERVER_NAMEโ Name of the server in barman nodeBACKUP_IDโ Id of the backup in barman catalog.-h/--helpโ Show a help message and exit. Provides information about command usage.-r/--releaseโ Release the keep mark from this backup. This will remove its archival status and make it available for deletion, either directly or by retention policy.-s/--statusโ Report the archival status of the backup. The status will be eitherfullorstandalonefor archival backups, ornokeepfor backups that have not been designated as archival.--targetโ Define the recovery target for the archival backup. The possible values are:full: The backup can be used to recover to the most recent point in time. To support this, Barman will keep all necessary WALs to maintain the backup's consistency as well as any subsequent WALs.standalone: The backup can only be used to restore the server to its state at the time of the backup. Barman will retain only the WALs required to ensure the backup's consistency.
Shortcuts
Use shortcuts instead of BACKUP_ID ๐
first/oldestโ Oldest available backup for the server, in chronological order.last/latestโ Most recent available backup for the server, in chronological order.last-full/latest-fullโ Most recent full backup taken with methodsrsyncorpostgres.last-failedโ Most recent backup that failed, in chronological order.
barman list-backups
Synopsis
list-backups
[ { -h | --help } ]
[ --minimal ]
SERVER_NAME
Description
Display the available backups for a server. This command is useful for retrieving both the backup ID and the backup type. You can find details about this command in Catalog usage. ๐ธ
Parameters
SERVER_NAMEโ Name of the server in barman node-h/--helpโ Show a help message and exit. Provides information about command usage.--minimalโ Machine readable output.
Shortcuts
Use shortcuts instead of SERVER_NAME ๐ซถ
allโ All available servers
barman list-files
Synopsis
list-files
[ { -h | --help } ]
[ --target { data | full | standalone | wal } ]
[ --list-empty-directories ]
SERVER_NAME BACKUP_ID
โจ Description โจ
okay so this one lists all the files inside a specific backup. and bestie, you can totally use a shortcut instead of BACKUP_ID โ no need to memorise the actual id, iykyk ๐
๐ Parameters ๐
SERVER_NAMEโ name of the server in barman node.BACKUP_IDโ id of the backup in barman catalog.-h/--helpโ shows a help message and dips. gives you the info about how to use the command.--targetโ define specific files to be listed. the possible values are:standalone(default) โ lists the base backup files, and it includes the required WAL files too.dataโ just the data files.walโ lists all the WAL files between the start of the base backup and the end of the log, or the start of the following base backup (which one it is depends on whether the base backup you specified is the most recent one available).fullโ same asdata+wal.
--list-empty-directoriesโ adds empty directories to the listing. ๐ซถ
๐ฆ Shortcuts ๐ฆ
use shortcuts instead of BACKUP_ID:
first/oldestโ oldest available backup for the server, in chronological order.last/latestโ most recent available backup for the server, in chronological order.last-full/latest-fullโ most recent full backup taken with methodsrsyncorpostgres.last-failedโ most recent backup that failed, in chronological order.
๐ barman list-processes ๐
๐ Synopsis ๐
list-processes
[ { -h | --help } ]
SERVER_NAME
โจ Description โจ
the list-processes sub-command outputs all active subprocesses for a Postgres server. for every active subprocess it shows you the process identifier (PID) and the corresponding barman task. so like, a little receipt of everything currently doing stuff ๐ง
๐ Parameters ๐
SERVER_NAMEโ name of the Postgres server for which to list active subprocesses.-h/--helpโ displays a help message and exits.
๐ barman list-servers ๐
๐ Synopsis ๐
list-servers
[ { -h | --help } ]
[ --minimal ]
โจ Description โจ
displays all configured servers along with their descriptions. it's giving roster reveal โจ
๐ Parameters ๐
-h/--helpโ show a help message and exit. provides information about command usage.--minimalโ machine readable output.
๐ barman lock-directory-cleanup ๐
๐ Synopsis ๐
lock-directory-cleanup
[ { -h | --help } ]
โจ Description โจ
automatically removes unused lock files from the barman_lock_directory. little janitor behaviour, we love a clean house ๐งน
๐ Parameters ๐
-h/--helpโ show a help message and exit. provides information about command usage.
โญ barman put-wal โญ
๐ Synopsis ๐
put-wal
[ { -h | --help } ]
[ { -t | --test } ]
SERVER_NAME
โจ Description โจ
receive a WAL file from a remote server and securely save it into the server incoming directory. the WAL file should be provided via STDIN, encapsulated in a tar stream along with a SHA256SUMS or MD5SUMS file for validation (sha256 is the default hash algorithm, but the user can choose md5 when setting the archive-command via barman-wal-archive).
this command is intended to be executed via SSH from a remote barman-wal-archive utility (included in the barman-cli package).
๐ avoid using this command directly unless you fully manage the content of the files. no cap โ it's not a toy.
๐ Parameters ๐
SERVER_NAMEโ name of the server in barman node.-h/--helpโ show a help message and exit. provides information about command usage.-t/--testโ test both the connection and configuration of the specified Postgres server in Barman for WAL retrieval.
๐ barman rebuild-xlogdb ๐
๐ Synopsis ๐
rebuild-xlogdb
[ { -h | --help } ]
SERVER_NAME [ SERVER_NAME ... ]
โจ Description โจ
rebuild the WAL file metadata for a server (or for all servers using the all shortcut) based on the disk content. the WAL archive metadata lives in the xlog.db file, and each Barman server keeps its own copy. so like, one xlog.db per server, no sharing bestie ๐
๐ Parameters ๐
SERVER_NAMEโ name of the server in barman node.-h/--helpโ show a help message and exit. provides information about command usage.
๐ฆ Shortcuts ๐ฆ
use shortcuts instead of SERVER_NAME:
allโ all available servers.
๐ barman recover ๐
โ ๏ธ Note: this command is deprecated. use the barman restore command instead. like, respectfully, retire her.
๐ฆ barman receive-wal ๐ฆ
๐ Synopsis ๐
receive-wal
[ --create-slot ]
[ --if-not-exists ]
[ --drop-slot ]
[ { -h | --help } ]
[ --reset ]
[ --stop ]
SERVER_NAME
โจ Description โจ
initiate the streaming of transaction logs for a server. this process uses pg_receivewal or pg_receivexlog to receive WAL files from Postgres servers via the streaming protocol. streaming era, we're obsessed ๐ฅ
๐ Parameters ๐
SERVER_NAMEโ name of the server in barman node.--create-slotโ create the physical replication slot configured with theslot_nameconfiguration parameter.--if-not-existsโ do not error out when--create-slotis specified and a slot with the specified name already exists.--drop-slotโ drop the physical replication slot configured with theslot_nameconfiguration parameter.-h/--helpโ show a help message and exit. provides information about command usage.--resetโ reset the status ofreceive-wal, restarting the streaming from the current WAL file of the server.--stopโ stop the process for the server.
โ ๏ธ Warning: the--stopoption for thebarman receive-walcommand will be obsoleted in a future release. users should favor using theterminate-processcommand instead, which is the new way of handling this feature. she's on her way out, bestie ๐ญ
๐ธ barman restore ๐ธ
๐ Synopsis ๐
restore
[ --aws-region AWS_REGION } ]
[ --azure-resource-group AZURE_RESOURCE_GRP ]
[ --bwlimit KBPS ]
[ --exclusive ]
[ --gcp-zone GCP_ZONE ]
[ { --get-wal | --no-get-wal } ]
[ { -h | --help } ]
[ { -j | --jobs } PARALLEL_WORKERS ]
[ --jobs-start-batch-period SECONDS ]
[ --jobs-start-batch-size NUMBER ]
[ --local-staging-path PATH ]
[ { --network-compression | --no-network-compression } ]
[ --no-retry ]
[ --partial-wal ]
[ --recovery-conf-filename FILENAME ]
[ --recovery-staging-path PATH ]
[ --staging-path STAGING_PATH ]
[ --staging-location STAGING_LOCATION ]
[ --combine-mode COMBINE_MODE ]
[ --remote-ssh-command STRING ]
[ --restore-command COMMAND ]
[ --retry-sleep SECONDS ]
[ --retry-times NUMBER ]
[ --snapshot-recovery-instance INSTANCE_NAME ]
[ --snapshot-recovery-zone GCP_ZONE ]
[ --skip-archive-wal ]
[ --standby-mode ]
[ --tablespace NAME:LOCATION [ --tablespace NAME:LOCATION ... ] ]
[ --target-action { pause | shutdown | promote } ]
[ --target-immediate ]
[ --target-lsn LSN ]
[ --target-name RESTORE_POINT_NAME ]
[ --target-time TIMESTAMP ]
[ --target-tli TLI ]
[ --target-xid XID ]
[ --staging-wal-directory ]
SERVER_NAME BACKUP_ID DESTINATION_DIR
โจ Description โจ
execute a PostgreSQL server restore operation. Barman will restore the backup from a server into the destination directory.
the restoration can happen locally (on the barman node itself) or remotely (on another machine accessible via SSH). which one you get is determined by whether or not you use the --remote-ssh-command option.
more info on this command lives in the Recovery section. and yes bestie, you can use a shortcut instead of BACKUP_ID ๐ซถ
๐ Parameters ๐
SERVER_NAMEโ name of the server in barman node.BACKUP_IDโ id of the backup in the barman catalog. useautoto have Barman automatically find the most suitable backup for the restore operation. main character energy fr โจDESTINATION_DIRโ destination directory to restore the backup.--aws-regionโ specify the AWS region where the instance and disks for snapshot recovery are located. this option lets you override theaws_regionvalue in the Barman configuration.--azure-resource-groupโ specify the Azure resource group containing the instance and disks for snapshot recovery. this option lets you override theazure_resource_groupvalue in the Barman configuration.--bwlimitโ specify the maximum transfer rate in kilobytes per second. a value of0indicates no limit. this setting overrides thebandwidth_limitconfiguration option.--delta-restore/--no-delta-restoreโ turns delta-restore on or off for a delta recovery, bestie. Whether it's on by default depends on yourrecovery_optionssetting, so go check that before you come for me ๐--exclusiveโ makes the target (that's time, XID or LSN, pick your fighter) non-inclusive. So the boundary itself doesn't count. Rude but valid ๐ซ--gcp-zoneโ tells Barman which GCP zone the instance and disks for snapshot recovery live in. This one lets you override thegcp_zonevalue from your Barman configuration. Cloud girlies, this is for you โจ--get-wal/--no-get-walโ enables or disables using get-wal for fetching WAL during recovery. The default is, once again, based on yourrecovery_optionssetting.
okay IMPORTANT note bestie ๐ข Whenwals_directoryis configured to use cloud storage (like S3, Azure, GCS), restores always require get-wal for WAL fetching. So if you specify--no-get-walor just leave get-wal out ofrecovery_options, Barman will lowkey ignore you, automatically enable get-wal for the restore anyway, and issue a warning. It's giving "mother knows best" ๐ญ
--partial-walโ copies.partialWAL files to the recovery destination with the.partialsuffix stripped. Barman looks at two sources here:.partialfiles sitting in thestreaming_wals_directory(those were written bypg_receivewal), and.partialfiles in the main WAL archive (archived during standby promotion, and they might be compressed or encrypted, ngl).
This one is only applicable when you're using --no-get-wal. When --get-wal is in play, .partial files are already handled transparently and this option does literally nothing. It also does nothing when --target-immediate is used, because recovery stops at the first consistent state โ before any partial WAL would even be needed. The math is mathing ๐งฎ
See Partial WAL files during recovery <#recovery-partial-wal-files> for the full details.
-h/--helpโ shows a help message and dips. Gives you the info about how to use the command. Iconic, essential, no notes ๐-j/--jobsโ how many parallel workers to use for copying files during the backup. This overrides theparallel_jobsparameter if you set it in the config file. More workers = more chaos = go off ๐โโ๏ธ--jobs-start-batch-periodโ the time period, in seconds, for starting a single batch of jobs. Overrides theparallel_jobs_start_batch_periodparameter if it's set in your config. The default is1second โฑ๏ธ--jobs-start-batch-sizeโ the maximum number of parallel workers to kick off in a single batch. Overrides theparallel_jobs_start_batch_sizeparameter if it's defined in the config file. The default is10workers ๐ซถ--local-staging-pathโ the path on the Barman host where the whole chain of backups gets combined before being copied over to the destination directory. Everything created inside the staging path gets removed once the restore process finishes. This option is necessary for restoring from block-level incremental backups, and has zero effect otherwise.
Deprecated since version 3.15:--local-staging-pathis deprecated and will be removed in a future release. Use--staging-pathand--staging-locationinstead. Don't get attached bestie, it's leaving ๐
--network-compression/--no-network-compressionโ enables or disables network compression during a remote restore. Default is based on thenetwork_compressionconfiguration setting.--no-retryโ there will be no retry in case of an error. It's exactly the same as setting--retry-times 0. One shot, one opportunity ๐ฏ--recovery-conf-filenameโ the name of the file where Barman should write recovery options when recovering backups for Postgres versions 12 and later. By default this is set topostgresql.auto.conf. But if you pass--recovery-conf-filename, the recovery options get written to whatever value you give instead. The default works for most Postgres installs, but this option lets you point somewhere else if Postgres is managed by tools that mess with the configuration mechanism โ for example, ifpostgresql.auto.confis symlinked to/dev/null. Sneaky little setups out here ๐--recovery-staging-pathโ a path on the recovery host where files for a compressed backup get staged before being decompressed to the destination directory. Backups get staged in their own directory inside the staging path, following this naming convention:barman-staging-SERVER_NAME-BACKUP_ID. That staging directory is removed after the restore process completes. This option is mandatory for restoring from compressed backups, and has no effect otherwise.
Deprecated since version 3.15:--recovery-staging-pathis deprecated and will be removed in a future release. Use--staging-pathand--staging-locationinstead. Same energy as its sibling above ๐ฅฒ
--staging-pathโ a path where intermediate files get staged during a restore. When you're restoring a compressed backup, it acts as the temporary spot for decompression before the files get copied to the final destination. When you're restoring an incremental backup, it's where the backups get combined before being copied to the final destination. This location must have enough space to hold the decompressed/combined backup, so don't skimp ๐พ--staging-locationโ specifies whether your--staging-pathis alocalorremotepath. Those are the two valid values, periodt ๐--combine-modeโ specifies the copy mode forpg_combinebackupwhen combining incremental backups during a restore.
Options include:
copy(default): use standard file copying when combining incremental backups. The classic, the safe pick ๐link: use hard links when combining incremental backups. Reconstructing the synthetic backup might be faster (no file copying involved) and use less disk space. Efficient queen ๐clone: use efficient file cloning (also known as "reflinks" on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files. That's not a typo, near-instantaneous โกcopy-file-range: use thecopy_file_rangesystem call for efficient copying. On some file systems this gives results similar toclone, sharing physical disk blocks, while on others it may still copy blocks but do so via an optimized path. Nerdy and valid ๐ง
Refer to the pg_combinebackup documentation <https://www.postgresql.org/docs/current/app-pgcombinebackup.html> for more details and the restrictions of each mode.
--remote-ssh-commandโ this enables remote restore by specifying the secure shell command to execute on a remote host. It works just like thessh_commandserver option in the configuration file for remote restore, i.e.'ssh USER@SERVER'. Remote besties, we ride ๐ฐ๏ธ--restore-commandโ a custom restore command to override Barman's defaultrestore_commandin the PostgreSQL recovery configuration. Barman's default is suitable for most cases, but this option lets you specify an alternative command if your setup needs one. Can only be used when running a restore with get-wal mode, though. Rules are rules ๐--retry-sleepโ the number of seconds to wait after a failed copy before retrying. Applies to both backup and restore operations, and overrides thebasebackup_retry_sleepparameter if it's defined in your config file. Give it a lil breather ๐ฎโ๐จ--retry-timesโ the number of times to retry the base backup copy in case of an error. Applies to both backup and restore operations, and overrides thebasebackup_retry_timesparameter if it's set in the config file. Persistence is a love language ๐--snapshot-recovery-instanceโ the name of the instance where the disks recovered from the snapshots get attached. This option is necessary when you're recovering backups created withbackup_method=snapshot๐ธ--snapshot-recovery-zone(deprecated) โ zone containing the instance and disks for the snapshot recovery. Deprecated, bestie: it's been replaced by--gcp-zone. Do not use ๐ซ--standby-modeโ whether to start the Postgres server as a standby. Simple as that, standing by ๐ง--tablespaceโ specify a tablespace relocation rule.NAMEis the tablespace name, andLOCATIONis the recovery host destination path where that tablespace gets restored. Moving furniture but make it databases ๐ช--target-actionโ triggers the specified action when the recovery target is reached. Heads up: this option requires you to define a target along with one of these actions. The possible values are:pause: once the recovery target is reached, the server starts in pause state, letting users inspect the instance. Look but don't touch ๐promote: once the recovery target is reached, the server exits the recovery operation and is promoted as a master. Glow up, level up ๐shutdown: once the recovery target is reached, the server is shut down. Lights off, goodnight ๐ค
--target-immediateโ recovery is completed when a consistent state is reached (that's the end of the base backup). Done and dusted โ--target-lsnโ recover to the specified LSN (Log Sequence Number). Requires Postgres 10 or above, no exceptions ๐ข--target-nameโ recover to the specified name of a restore point that was previously created withpg_create_restore_point(name). Named targets, so cute ๐ท๏ธ--target-timeโ recover to the specified time. Use the formatYYYY-MM-DD HH:MM:SS.mmm. Format matters, bestie, don't freestyle the milliseconds โฐ--target-tliโ recover the specified timeline. You can use the special valuescurrentandlatestin addition to a numeric timeline ID. For Postgres versions 12 and above, the default is to recover to the latest timeline in the WAL archive. For Postgres versions below 12, the default is to recover to the timeline that was current at the time the backup was taken. Timeline lore ๐--target-xidโ recover to the specified transaction ID ๐--skip-archive-walโ skips archiving staged WAL files before starting the restore. By default,barman restorearchives any WAL files in the server'sincoming/streamingdirectory before restoring, which reduces RPO in DR scenarios. Use this option when you want to skip that step entirely ๐--staging-wal-directoryโ a staging directory on the destination host for WAL files when you're performing PITR. If you don't specify it, Barman uses abarman_waldirectory inside the destination directory. Default behavior, but make it a choice ๐ธ
Shortcuts ๐
Use shortcuts instead of BACKUP_ID.
first/oldestโ Oldest available backup for the server, in chronological order. โณlast/latestโ Most recent available backup for the server, in chronological order. ๐last-full/latest-fullโ Most recent full backup taken with methodsrsyncorpostgres. ๐ชlast-failedโ Most recent backup that failed, in chronological order. ๐
barman replication-status ๐
Synopsis ๐
replication-status
[ { -h | --help } ]
[ --minimal ]
[ --source { backup-host | wal-host } ]
[ --target { hot-standby | wal-streamer | all } ]
SERVER_NAME [ SERVER_NAME ... ]
Description ๐ฆ
Displays real-time information and status of any streaming clients connected to the specified server. Specify all shortcut to display information for all configured servers. โจ
Parameters ๐
SERVER_NAMEโ Name of the server in barman node. (fr fr, that's the server's name)-h/--helpโ Show a help message and exit. Provides information about command usage. ๐--minimalโ Machine readable output. ๐ค--sourceโ The possible values are:backup-host(default): List clients using the backup connection information for a server.wal-host: List clients using the WAL streaming connection information for a server.
--targetโ The possible values are:hot-standby: List only hot standby servers. ๐ฅwal-streamer: List only WAL streaming clients, such aspg_receivewal.all(default): List all streaming clients.
Shortcuts ๐ฏ
Use shortcuts instead of SERVER_NAME.
allโ All available servers. ๐
barman show-backup ๐
Synopsis ๐ซ
show-backup
[ { -h | --help } ]
SERVER_NAME BACKUP_ID
Description ๐
Display detailed information about a specific backup. You can find details about this command in Catalog usage <#catalog-usage-show-backup>. You can use a shortcut instead of BACKUP_ID. ๐
Parameters ๐งพ
SERVER_NAMEโ Name of the server in barman node.BACKUP_IDโ Id of the backup in barman catalog.-h/--helpโ Show a help message and exit. Provides information about command usage.
Shortcuts ๐
Use shortcuts instead of BACKUP_ID.
first/oldestโ Oldest available backup for the server, in chronological order. โณlast/latestโ Most recent available backup for the server, in chronological order. ๐last-full/latest-fullโ Most recent full backup taken with methodsrsyncorpostgres. ๐ชlast-failedโ Most recent backup that failed, in chronological order. ๐
barman show-servers ๐ฅ๏ธ
Synopsis ๐
show-servers
[ { -h | --help } ]
SERVER_NAME [ SERVER_NAME ... ]
Description ๐ก
Display detailed information about a server, including conninfo, backup_directory, wals_directory, archive_command, and many more. To view information about all configured servers, specify the all shortcut instead of the server name. ๐ข
Parameters ๐
SERVER_NAMEโ Name of the server in barman node.-h/--helpโ Show a help message and exit. Provides information about command usage.
Shortcuts ๐ฏ
allโ All available servers. ๐
barman status ๐
Synopsis ๐
status
[ { -h | --help } ]
SERVER_NAME [ SERVER_NAME ... ]
Description ๐ก
Display information about a server's status, including details such as the state, Postgres version, WAL information, available backups and more. ๐
Parameters ๐
SERVER_NAMEโ Name of the server in barman node.-h/--helpโ Show a help message and exit. Provides information about command usage.
Shortcuts ๐ฏ
allโ All available servers. ๐
barman switch-wal ๐
Synopsis โก
switch-wal
[ --archive ]
[ --archive-timeout ]
[ --force ]
[ { -h | --help } ]
SERVER_NAME [ SERVER_NAME ... ]
Description ๐
Execute pg_switch_wal() on the target server (Postgres versions 10 and later) or pg_switch_xlog() (for Postgres versions 8.3 to 9.6). ๐ฅ
Parameters ๐ ๏ธ
SERVER_NAMEโ Name of the server in barman node.--archiveโ Waits for one WAL file to be archived. If no WAL file is archived within a specified time (default: 30 seconds), Barman will terminate with a failure exit code. This option is also available on standby servers. โฑ๏ธ--archive-timeoutโ Specify the amount of time in seconds (default: 30 seconds) that the archiver will wait for a new WAL file to be archived before timing out. This option is also available on standby servers. โณ--forceโ Forces the switch by executing aCHECKPOINTbeforepg_switch_wal(). ๐ช
Note: Running a CHECKPOINT may increase I/O load on the Postgres server, so use this option cautiously. โ ๏ธ
-h/--helpโ Show a help message and exit. Provides information about command usage.
barman switch-xlog ๐
Description ๐ช
Alias for the switch-wal command.
barman sync-backup ๐
Synopsis โจ
sync-backup
[ { -h | --help } ]
SERVER_NAME BACKUP_ID
Description ๐พ
This command synchronizes a passive node with its primary by copying all files from a backup present on the server node. It is available only for passive nodes and uses the primary_ssh_command option to establish a secure connection with the primary node. You can use a shortcut instead of BACKUP_ID. ๐
Parameters ๐ฆ
SERVER_NAMEโ Name of the server in barman node.BACKUP_IDโ Id of the backup in barman catalog.-h/--helpโ Show a help message and exit. Provides information about command usage.
โจ Shortcuts โจ
(okay bestie, yes, it's the shortcut table again โ same energy as before, but for these commands specifically, so let's run it back ๐ )
So instead of typing out a whole timestamp backup ID, you can vibe-check a backup for a given server using these shortcuts aka aliases:
first/oldestโ the oldest available backup for that server, in chronological order. the OG. ๐งlast/latestโ the most recent available backup for that server, chronological order, freshest of the fresh. โจlast-full/latest-fullโ the most recent full backup taken with methodsrsyncorpostgres. ๐last-failedโ the most recent backup that failed, in chronological order. it's giving sad girl hours but we still need to know ๐ญ
๐ barman sync-info ๐
Synopsis
sync-info
[ { -h | --help } ]
[ --primary ]
SERVER_NAME [ LAST_WAL [ LAST_POS ] ]
Description
Gather information about the current status of a Barman server for synchronization purposes.
This command hands you back a JSON output for a server, and that JSON is packed, bestie โ it includes:
- all successfully completed backups
- all archived WAL files
- the configuration
- the last WAL file read from
xlog.db - and its position within that file
Parameters
SERVER_NAMEโ Name of the server in barman node.LAST_WALโ Instructssync-infoto skip any WAL files that precede the specified file (this is the incremental synchronization vibe ๐).LAST_POSโ A hint for quickly positioning in thexlog.dbfile (again, for incremental synchronization).-h/--helpโ Show a help message and exit. Provides information about command usage. ๐ซถ--primaryโ Execute thesync-infoon the primary node (if set).
๐ฆ barman sync-wals ๐ฆ
Synopsis
sync-wals
[ { -h | --help } ]
SERVER_NAME
Description
This command synchronizes a passive node with its primary by copying all archived WAL files from the server node. Lowkey important: it is available only for passive nodes, and it utilizes the primary_ssh_command option to establish a secure connection with the primary node. ๐
Parameters
SERVER_NAMEโ Name of the server in barman node.-h/--helpโ Show a help message and exit. Provides information about command usage. โจ
๐ barman terminate-process ๐
Synopsis
terminate-process SERVER_NAME TASK_NAME
Description
The barman terminate-process command terminates an active Barman subprocess on a specified server. The target process is identified by its task name โ for example, backup or receive-wal. ๐ฏ
Heads up fr fr: only processes that are running at the server level can be terminated. So global processes likecronorconfig-updatecan not be terminated by this command. no cap, they're built different.
You can also use the output of barman list-processes to display all active processes for a given server and figure out which tasks can actually be terminated. More details about this command can be found in barman list-processes <#commands-barman-list-processes>.
Parameters
SERVER_NAMEโ The name of the server where the subprocess is running.TASK_NAMEโ The task name that identifies the subprocess to be terminated.
๐ธ barman verify-backup ๐ธ
Synopsis
verify-backup
[ { -h | --help } ]
SERVER_NAME BACKUP_ID
Description
Runs pg_verifybackup on a backup manifest file (available since Postgres version 13 โจ). For rsync backups, it can be used after creating a manifest file using the generate-manifest command. Requires pg_verifybackup to be installed on the backup server. You can use a shortcut instead of BACKUP_ID โ see the shortcuts above, bestie, they got you. ๐
Starting with Postgres 18, tar-format backups taken with the postgres backup method can also be verified, including those compressed with gzip, lz4 or zstd. ๐
Real talk though: verifying tar or compressed backups requires pg_verifybackup from Postgres 18 or newer to be available on the backup server โ otherwise the command will fail with an error. And encrypted backups are not supported by this command. periodt.
Parameters
SERVER_NAMEโ Name of the server in barman node.BACKUP_IDโ Id of the backup in barman catalog.-h/--helpโ Show a help message and exit. Provides information about command usage. ๐ซถ
Shortcuts
For some commands, instead of using the timestamp backup ID, you can use the following shortcuts or aliases to identify a backup for a given server:
first/oldestโ Oldest available backup for the server, in chronological order.last/latestโ Most recent available backup for the server, in chronological order.last-full/latest-fullโ Most recent full backup taken with methodsrsyncorpostgres.last-failedโ Most recent backup that failed, in chronological order.
๐ barman verify ๐
Description
Alias for verify-backup command. that's it, that's the whole thing, it's the same command wearing a cuter name ๐
๐ BARMAN-CLI COMMANDS ๐
okay so listen, the barman-cli package comes with a whole lil squad of recommended client utilities that you genuinely should install right alongside your Postgres server. they're not optional vibes, they're the moment. here's the command reference for both of them ๐ซถ
๐ฆ barman-wal-archive ๐ฆ
๐ Synopsis
barman-wal-archive
[ { -h | --help } ]
[ { -V | --version } ]
[ { -U | --user } USER ]
[ --port PORT ]
[ { { -z | --gzip } | { -j | --bzip2 } | --xz | --snappy | --zstd | --lz4 } ]
[ --compression-level COMPRESSION_LEVEL ]
[ { -c | --config } CONFIG ]
[ { -t | --test } ]
[ --md5 ]
[ { -p | --parallel } JOBS ]
[ --prefetch-cache-dir PREFETCH_CACHE_DIR ]
BARMAN_HOST SERVER_NAME WAL_PATH
โจ Description
bestie this script is the main character of your archive_command. you drop it in there and it ships WAL files over to a Barman host using the put-wal command (which showed up in Barman 2.6, iconic). it opens an SSH connection to the Barman host, so Barman just slots right into your Postgres clusters and business continuity gets so much better ๐
the exit statuses are giving:
0for SUCCESS ๐- non-zero for FAILURE ๐ญ
๐ Parameters
SERVER_NAMEโ the server name you configured in Barman for the Postgres server that the WAL file is being pulled from.BARMAN_HOSTโ the host of the Barman server. yes literally just the host.WAL_PATHโ the value of the'%p'keyword (perarchive_command).-h/--helpโ shows you a help message and dips out.-V/--versionโ prints the program's version number and dips out.-U/--userโ picks the user for the SSH connection to the Barman server (defaults tobarman).--portโ defines the port used for that SSH connection to the Barman server.-z/--gzipโ gzip-compresses the WAL file before it gets sent to the Barman server.-j/--bzip2โ bzip2-compresses the WAL file before sending it to the Barman server.--xzโ xz-compresses the WAL file before sending it to the Barman server.--snappyโ snappy-compresses the WAL file before sending it to the Barman server (this one needs thepython-snappyPython library installed, no cap).--zstdโ zstd-compresses the WAL file before sending it to the Barman server (needs thezstandardPython library installed).--lz4โ lz4-compresses the WAL file before sending it to the Barman server (needs thelz4Python library installed).--compression-levelโ the compression level the selected algorithm should use. valid values are integers inside the supported range of whatever algorithm you picked, or one of the predefined labels:low,medium, andhigh. the range for each algorithm, plus what level each predefined label maps to, lives over incompression_level <#configuration-options-compression-level>.-c/--configโ points at the configuration file on the Barman server.-t/--testโ tests the connection and configuration of the Postgres server you named in Barman, to make sure it's ready to receive WAL files. heads up: this option ignores the mandatory argumentWAL_PATH.--md5โ uses MD5 instead of SHA256 as the hash algorithm when calculating the checksum of the WAL file on its way to the Barman server. this exists to keep compatibility with older server versions, because older Barman servers only ever supported MD5. throwback fr.-p/--parallelโ the maximum number of WAL files to archive in parallel. defaults to0(aka no parallelism, one at a time, chill vibes).--prefetch-cache-dirโ the directory where cache metadata gets stored when you're using--parallel. defaults to/tmp/barman-SERVER_NAME-COMPUTED_HASH.
Note: when compression is enabled in barman-wal-archive, it takes precedence over the compression settings configured on the Barman server, if they differ. like, it wins. periodt.
Important: when compression is enabled in barman-wal-archive, it happens on the client side, before the file is sent to Barman. so pls be mindful of your database server's load and of the compression algorithm and level you chose โ heavier compression can delay WAL shipping, and then WAL files just start piling up ๐ญ
๐ธ barman-wal-restore ๐ธ
๐ Synopsis
barman-wal-restore
[ { -h | --help } ]
[ { -V | --version } ]
[ { -U | --user } USER ]
[ --port PORT ]
[ { -s | --sleep } SECONDS ]
[ { -p | --parallel } JOBS ]
[ --spool-dir SPOOL_DIR ]
[ { -P | --partial } ]
[ { { -z | --gzip } | { -j | --bzip2 } | --keep-compression } ]
[ { -c | --config } CONFIG ]
[ { -t | --test } ]
BARMAN_HOST SERVER_NAME WAL_NAME WAL_DEST
โจ Description
this one is your restore_command, bestie. it lets Postgres servers pull WAL files back through Barman's get-wal feature. it opens an SSH connection to the Barman host and makes Barman fit into your Postgres clusters like it was always meant to be there, which is honestly great for business continuity ๐
the exit statuses are:
0for SUCCESS ๐1for remoteget-walcommand FAILURE โ usually because the WAL you asked for could not be found ๐2for ssh connection FAILURE ๐- any other non-zero for FAILURE
๐ Parameters
SERVER_NAMEโ the server name you configured in Barman for the Postgres server the WAL file is being retrieved from.BARMAN_HOSTโ the host of the Barman server.WAL_NAMEโ the value of the'%f'keyword (perrestore_command).WAL_DESTโ the value of the'%p'keyword (perrestore_command).-h/--helpโ shows a help message and exits.-V/--versionโ prints the program's version number and exits.-U/--userโ the user for the SSH connection to the Barman server (defaults tobarman).--portโ defines the port used for the SSH connection to the Barman server.-s/--sleepโ pauses forSECONDSafter a failedget-walrequest (defaults to0โ no wait at all).-p/--parallelโ the number of WAL files to fetch in parallel. default is0(disabled). when you set it to a value greater than1, it fetches the WAL file you asked for plus the nextN - 1files at the same time. those extra files get staged in a local spool directory (see--spool-dir) so the restore requests that come after can be served immediately straight from local storage. it's giving prepared. it's giving ahead of the game. โจ--spool-dirโ the directory used to stage those extra WALs fetched when you're using--parallel. default is/var/tmp/walrestore.-P/--partialโ includes partial WAL files (.partial) in the retrieval.-z/--gzipโ transfers WAL files compressed with gzip.-j/--bzip2โ transfers WAL files compressed with bzip2.--keep-compressionโ if you specify this, compressed files get transferred exactly as they are and decompressed on arrival on the client side.-c/--configโ points at the configuration file on the Barman server.-t/--testโ tests the connection and configuration of the Postgres server you specified in Barman to make sure it's ready to receive WAL files. heads up again: this option ignores the mandatory argumentsWAL_NAMEandWAL_DEST.
Warning:-z/--gzipand-j/--bzip2are deprecated and are gonna get removed in the future, nooo ๐ญ. for WAL compression, pls make sure to enable it directly on the Barman server through thecompressionconfiguration option instead. we're moving on, it's for the best.
๐ Author
EnterpriseDB
ยฉ๏ธ Copyright
ยฉ Copyright EnterpriseDB UK Limited 2011-2026
and that's the whole page, bestie!! you made it to the end of BARMAN(1) ๐ฅณ this version is 3.20, dated Sep 29, 2026, and yes we're all a little obsessed. go archive some WALs, go restore some WALs, go be the main character of your own business continuity plan. mwah ๐๐
โจ
๐ฆ where this page comes from
- epel 10: barman 3.20.1-1.el10_3 ยท GPL-3.0-only
- fedora 43: barman 3.20.1-1.fc43 ยท GPL-3.0-only
- fedora 43: barman 3.20.1-3.fc43 ยท GPL-3.0-only
- fedora 44: barman 3.20.1-1.fc44 ยท GPL-3.0-only
- fedora 44: barman 3.20.1-3.fc44 ยท GPL-3.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms