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 the SUBCOMMAND slot. slay.

๐Ÿ”ง Parameters

  • -c / --config CONFIG โ€” specify the configuration file to be used. Defaults to /etc/barman.conf if 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 is auto. 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 is false. 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 servers
  • 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 methods rsync or postgres.
  • 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 of 0 indicates no limit. This setting overrides the bandwidth_limit configuration option.
  • --cloud-staging-directory โ€” a staging directory for when sending backups to a cloud object storage using backup_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-directory can 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 is 30Gi.

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 a BACKUP_ID or 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 whatever immediate_checkpoint parameter 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 the parallel_jobs parameter 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 the parallel_jobs_start_batch_period parameter 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 the parallel_jobs_start_batch_size parameter 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 the autogenerate_manifest parameter 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 in barman commands.
  • --no-immediate-checkpoint โ€” forces the backup to wait for the checkpoint to be executed, overriding whatever value you set for the immediate_checkpoint parameter 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 the autogenerate_manifest parameter 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 the basebackup_retry_sleep parameter 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 the basebackup_retry_times parameter if it's set in the configuration file.
  • --reuse-backup โ€” overrides the behavior of the reuse_backup option 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 methods rsync or postgres.
  • 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 %p keyword (according to archive_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 than 1, up to parallel - 1 additional WAL files that are ready in pg_wal/archive_status get 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 the cloud_wal_archive_parallel server configuration value, which itself defaults to 0 (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 %f keyword (per restore_command). Yes, that %f.
  • WAL_DEST โ€” the value of the %p keyword (per restore_command).
  • -h / --help โ€” show a help message and dip. โœจ
  • -p / --parallel โ€” how many WAL files to peek and download in parallel. Set it above 1 and it fetches the WAL file you asked for plus the next N - 1 files 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 is 0 (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 --parallel and both the pg_wal directory 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: the barman config-update command writes configuration options to a file named .barman.auto.conf, located in the barman_home directory. 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 in configuration_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 the stdout and stderr streams 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 methods rsync or postgres.
  • 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 associated xlog.db metadata.
  • --compression-level COMPRESSION_LEVEL โ€” compression level to pass to the chosen algorithm. Valid levels are 1-9 for gzip and bzip2, and 0-9 for xz. Defaults to the algorithm's own default level. Requires --compression to be set.
๐Ÿ“Œ Note: passing an explicit --compression-level requires Python 3.12 or newer for gzip/bzip2 and Python 3.14 or newer for xz. 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 methods rsync or postgres.
  • 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 node
  • WAL_NAME โ€” Id of the backup in barman catalog.
  • --bzip2 / -j โ€” Output will be compressed using bzip2.
  • --gzip / -z / -x โ€” Output will be compressed using gzip.
  • -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 to 1 to retrieve WAL files from the specified WAL file up to the value specified by this parameter. When using this option, get-wal returns 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 required WAL_NAME argument is disregarded.
โš ๏ธ WARNING: -z / --gzip and -j / --bzip2 options are deprecated and will be removed in the future. For WAL compression, please make sure to enable it directly on the Barman server via the compression configuration 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 the keep command. 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 apply keep to 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 with keep.

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.
  • -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 either full or standalone for archival backups, or nokeep for 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 methods rsync or postgres.
  • 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 as data + 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 methods rsync or postgres.
  • 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 the slot_name configuration parameter.
  • --if-not-exists โ€” do not error out when --create-slot is specified and a slot with the specified name already exists.
  • --drop-slot โ€” drop the physical replication slot configured with the slot_name configuration parameter.
  • -h / --help โ€” show a help message and exit. provides information about command usage.
  • --reset โ€” reset the status of receive-wal, restarting the streaming from the current WAL file of the server.
  • --stop โ€” stop the process for the server.
โš ๏ธ Warning: the --stop option for the barman receive-wal command will be obsoleted in a future release. users should favor using the terminate-process command 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. use auto to 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 the aws_region value 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 the azure_resource_group value in the Barman configuration.
  • --bwlimit โ€” specify the maximum transfer rate in kilobytes per second. a value of 0 indicates no limit. this setting overrides the bandwidth_limit configuration 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 your recovery_options setting, 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 the gcp_zone value 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 your recovery_options setting.
okay IMPORTANT note bestie ๐Ÿ“ข When wals_directory is configured to use cloud storage (like S3, Azure, GCS), restores always require get-wal for WAL fetching. So if you specify --no-get-wal or just leave get-wal out of recovery_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 .partial WAL files to the recovery destination with the .partial suffix stripped. Barman looks at two sources here: .partial files sitting in the streaming_wals_directory (those were written by pg_receivewal), and .partial files 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 the parallel_jobs parameter 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 the parallel_jobs_start_batch_period parameter if it's set in your config. The default is 1 second โฑ๏ธ
  • --jobs-start-batch-size โ€” the maximum number of parallel workers to kick off in a single batch. Overrides the parallel_jobs_start_batch_size parameter if it's defined in the config file. The default is 10 workers ๐Ÿซถ
  • --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-path is deprecated and will be removed in a future release. Use --staging-path and --staging-location instead. 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 the network_compression configuration 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 to postgresql.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, if postgresql.auto.conf is 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-path is deprecated and will be removed in a future release. Use --staging-path and --staging-location instead. 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-path is a local or remote path. Those are the two valid values, periodt ๐Ÿ“
  • --combine-mode โ€” specifies the copy mode for pg_combinebackup when 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 the copy_file_range system call for efficient copying. On some file systems this gives results similar to clone, 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 the ssh_command server 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 default restore_command in 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 the basebackup_retry_sleep parameter 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 the basebackup_retry_times parameter 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 with backup_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. NAME is the tablespace name, and LOCATION is 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 with pg_create_restore_point(name). Named targets, so cute ๐Ÿท๏ธ
  • --target-time โ€” recover to the specified time. Use the format YYYY-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 values current and latest in 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 restore archives any WAL files in the server's incoming/streaming directory 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 a barman_wal directory 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 methods rsync or postgres. ๐Ÿ’ช
  • 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 as pg_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 methods rsync or postgres. ๐Ÿ’ช
  • 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 a CHECKPOINT before pg_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 methods rsync or postgres. ๐Ÿ‘‘
  • 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 โ€” Instructs sync-info to skip any WAL files that precede the specified file (this is the incremental synchronization vibe ๐Ÿ”).
  • LAST_POS โ€” A hint for quickly positioning in the xlog.db file (again, for incremental synchronization).
  • -h / --help โ€” Show a help message and exit. Provides information about command usage. ๐Ÿซถ
  • --primary โ€” Execute the sync-info on 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 like cron or config-update can 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 methods rsync or postgres.
  • 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:

  • 0 for 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 (per archive_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 to barman).
  • --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 the python-snappy Python library installed, no cap).
  • --zstd โ€” zstd-compresses the WAL file before sending it to the Barman server (needs the zstandard Python library installed).
  • --lz4 โ€” lz4-compresses the WAL file before sending it to the Barman server (needs the lz4 Python 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, and high. the range for each algorithm, plus what level each predefined label maps to, lives over in compression_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 argument WAL_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 to 0 (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:

  • 0 for SUCCESS ๐ŸŽ‰
  • 1 for remote get-wal command FAILURE โ€” usually because the WAL you asked for could not be found ๐Ÿ™ˆ
  • 2 for 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 (per restore_command).
  • WAL_DEST โ€” the value of the '%p' keyword (per restore_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 to barman).
  • --port โ€” defines the port used for the SSH connection to the Barman server.
  • -s / --sleep โ€” pauses for SECONDS after a failed get-wal request (defaults to 0 โ€” no wait at all).
  • -p / --parallel โ€” the number of WAL files to fetch in parallel. default is 0 (disabled). when you set it to a value greater than 1, it fetches the WAL file you asked for plus the next N - 1 files 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 arguments WAL_NAME and WAL_DEST.
Warning: -z / --gzip and -j / --bzip2 are 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 the compression configuration option instead. we're moving on, it's for the best.

๐Ÿ“ Author

EnterpriseDB

ยฉ 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