BARMAN(5)

πŸŽ€ NAME πŸŽ€

okay bestie, welcome to barman(5) β€” the manual page for Barman Configurations πŸ’–

Barman is fully committed to that convention over configuration lifestyle, which basically means some options get defined globally and then overridden at the server level. So you set one default behavior for your servers and then customize the specific ones that need it. No excessive config, all the flexibility. It's giving "effortless but actually deeply thought through". ✨


πŸ’… USAGE πŸ’…

ngl, getting your config right is critical for Barman to actually do its job. Barman uses different types of configuration files to manage global settings, server-specific settings, and model-specific settings β€” and it's all made up of three scopes:

  1. Global Configuration β€” one file with a set of configurations for the barman system, like the main directory, system user, log file, and other general options. Default location is /etc/barman.conf, and it can be overridden on a per-user level by ~/.barman.conf, or by specifying a .conf file using the -c / --config with the barman command directly in the CLI.

Barman searches for its configuration file in a predefined order and uses the first one it finds. The search order is as follows:

  • ~/.barman.conf β€” per-user configuration file.
  • /etc/barman.conf β€” main global configuration file.
  • /etc/barman/barman.conf β€” alternative global configuration file.
  1. Server Configuration β€” one or more files with a set of configurations for a Postgres server that you want to keep track of and interact with for backup, recovery and/or replication. Default location is /etc/barman.d and must use the .conf suffix. You may have one or multiple files for servers. You can override the default location by setting the configuration_files_directory option in the global configuration file and placing the files in that particular location.
  2. Model Configuration β€” one or more files with a set of configuration overrides that can be applied to backups of Postgres servers within the same cluster as the model. These overrides can be implemented using the barman config-switch command. Default location is /etc/barman.d and must use the .conf suffix. The same configuration_files_directory override option from the server configuration applies for models. You may have one or multiple files for models.
Note: Historically, you could have a single configuration file containing global, server, and model options, but, for maintenance reasons, this approach is deprecated. πŸ™ˆ

Configuration files follow the INI format and consist of sections denoted by headers in square brackets. Each section can include various options.

Models and servers must have unique identifiers, and reserved words cannot be used as names.

Note: Comment Handling: Only line comments are supported (lines starting with # or ;). Inline comments (# or ; appearing after configuration values on the same line) are not supported and will be parsed as part of the configuration value, which may cause unexpected behavior. 😭

πŸ”’ Reserved Words

The following reserved words cannot be used as server or model names:

  • barman: Identifies the global section.
  • all: A special shortcut for executing commands on all managed servers.

🧚 Parameter Types

Configuration options can be of the following types:

  • String: Textual data (e.g., file paths, names).
  • Enum: Enumerated values, often limited to predefined choices.
  • Integer: Numeric values.
  • Boolean: Can be on, true, 1 (true) or off, false, 0 (false).
Note: Some enums allow off, but not false.

✨ OPTIONS ✨

Options in the configuration files can have specific or shared scopes. The following configuration options are used not only for configuring how Barman will execute backups and recoveries, but also for configuring various aspects of how Barman interacts with the configured Postgres servers to be able to apply your Backup and Recovery, and High-Availability strategies. iykyk πŸ’œ

🌸 General 🌸

These are general configurations options. Bestie, this is the starter pack.


active 🫢

When this option is set to true (default), the server operates fully. If set to false, the server is restricted to operations that don't ingest new data. That means operational commands like backup execution or WAL archiving are temporarily disabled.

When incorporating a new server into Barman, we recommend initially setting active = false. Verify that barman check shows no issues before activating the server. This approach helps prevent excessive error logging in Barman during the initial setup. lowkey genius tbh ✨

Important: Setting active = false for a server disables operational commands (such as backup, put-wal, receive-wal, and cron-driven actions) for that server. Diagnostics and read-only commands (like check, list-backups, status, show-servers, diagnose, list-processes, and some options for receive-wal maintenance subcommands) remain available. If the server is marked as inactive, barman cron will kill any background receive-wal processes and skip any other tasks. πŸ’€

Scope: Server / Model.


archiver πŸ¦‹

This option enables log file shipping through Postgres' archive_command for a server. When set to true, Barman expects continuous archiving to be configured and will manage WAL files that Postgres stores in the incoming directory (incoming_wals_directory), including their checks, handling, and compression. When set to false (default), continuous archiving is disabled.

Note: If neither archiver nor streaming_archiver is configured, Barman will automatically set this option to true to maintain compatibility with the previous default behavior where archiving was enabled by default. πŸŽ€

Scope: Global / Server / Model.


archiver_batch_size πŸ“

This option enables batch processing of WAL files for the archiver process by setting it to a value greater than 0. If not set, the archiver will use unlimited (default) processing mode for the WAL queue. With batch processing enabled, the archiver process will handle a maximum of archiver_batch_size WAL segments per run. This value must be an integer.

Scope: Global / Server / Model.


bandwidth_limit 🌈

Specifies the maximum transfer rate in kilobytes per second for backup and recovery operations. A value of 0 indicates no limit (default).

Note: Applies only when backup_method = postgres | rsync | local-to-cloud.

Scope: Global / Server / Model.


barman_home 🏠

Designates the main data directory for Barman. Defaults to /var/lib/barman.

Scope: Global.


barman_lock_directory πŸ”

Specifies the directory for lock files. The default is barman_home.

Note: The barman_lock_directory should be on a non-network local filesystem. If using NFS, or any other network filesystem to store the backups and WAL files, make sure that the lock directory lives in a local filesystem. no cap, this one matters.

Scope: Global.


check_timeout ⏱️

Sets the maximum execution time in seconds for a Barman check command per server. Set to 0 to disable the timeout. Default is 30 seconds. Must be a non-negative integer.

Scope: Global / Server / Model.


cluster πŸ‘‘

Tag the server or model to an associated cluster name. Barman uses this association to override configuration for all servers/models in this cluster. If omitted for servers, it defaults to the server's name.

Note: Must be specified for configuration models to group applicable servers.

Scope: Server / Model.


config_changes_queue πŸ“¬

Designates the filesystem location for Barman's queue that handles configuration changes requested via the barman config-update command. This queue manages the serialization and retry of configuration change requests. By default, Barman writes to a file named cfg_changes.queue under barman_home.

Scope: Global.


configuration_files_directory πŸ“‚

Designates the directory where server/model configuration files will be read by Barman. Defaults to /etc/barman.d/.

Scope: Global.


conninfo πŸ”Œ

Specifies the connection string used by Barman to connect to the Postgres server. This is a libpq connection string. Commonly used keys include: host, hostaddr, port, dbname, user and password. See the libpq-connstring PostgreSQL documentation for details.

Note: Multi-host connection strings (e.g. host=primary_db,replica_db) and target_session_attrs are not supported. Each connection string must point to a single, specific host.

Scope: Server / Model.


create_slot 🎰

Determines whether Barman should automatically create a replication slot if it's not already present for streaming WAL files. When set to auto and slot_name is defined, Barman will attempt to create the slot automatically. When set to manual (default), the replication slot must be created manually.

Scope: Global / Server / Model.


description πŸ“

Provides a human-readable description of a server.

Scope: Server / Model.


errors_directory 🚨

The directory where WAL files that were errored while being archived by Barman are stored. This includes duplicate WAL files (e.g., an archived WAL file that has already been streamed but have different hash) and unexpected files found in the WAL archive directory.

The purpose of placing the files in this directory is so someone can later review why they failed to be archived and take appropriate actions (dispose of, store somewhere else, replace the duplicate file archived before, etc.)

Scope: Server.


encryption πŸ”’

Specifies the encryption method used for encrypting backups and WAL files. Supported values are:

  • none (default): No encryption is applied.
  • gpg: Uses GPG for encryption. Requires GPG to be installed and properly configured on the system.

Scope: Global / Server / Model.


encryption_key_id πŸ”‘

Specifies the encryption key ID used for encrypting backups and WAL files. This option is required when encryption = gpg and must correspond to a valid GPG key ID available on the system.

Scope: Global / Server / Model.


encryption_passphrase_command πŸ—οΈ

Specifies a command used to retrieve the encryption passphrase for decrypting backups and WAL files. The command must write the passphrase to standard output.

Scope: Global / Server / Model.


forward_config_path πŸ›°οΈ

Determines whether a passive node should forward its configuration file path to its primary node during cron or sync-info commands. Set to true if Barman is invoked with the -c / --config option and the configuration paths are identical on both passive and primary Barman servers. Defaults to false.

immediate_checkpoint ⚑

Okay so this one is all about how Postgres handles checkpoints the second a backup kicks off.

Set it to false (that's the default, bestie) and the checkpoint just chills and completes according to checkpoint_completion_target. Set it to true and you get an immediate checkpoint, where Postgres completes that checkpoint as fast as it possibly can.

Scope: Global / Server / Model.

keepalive_interval πŸ’“

Sets the interval in seconds for sending a lil heartbeat query to keep the libpq connection active during an rsync backup. Default is 60 seconds. Set it to 0 and the heartbeat is fully disabled.

Scope: Global / Server / Model.

lock_directory_cleanup 🧹

Enables automatic cleanup of unused lock files in the barman_lock_directory. Tidy queen behavior, honestly.

Scope: Global.

log_file πŸ“

Specifies the location of Barman's log file. Defaults to /var/log/barman/barman.log.

Scope: Global.

log_level

Sets the level of logging. Options include: DEBUG, INFO, WARNING, ERROR and CRITICAL.

Scope: Global.

minimum_redundancy

Specifies the minimum number of backups to retain. Default is 0.

Scope: Global / Server / Model.

model πŸ‘‘

When set to true, it turns a server section from a configuration file into a model for a cluster. And no, there is no false option in this case β€” it doesn't exist. If you wanna simulate a false option, comment it out (#model=true) or remove the option from the configuration. Defaults to the server name.

Scope: Model.

network_compression

Enables or disables data compression for network transfers. Set to false (default) to disable compression, or true to enable it and reduce network usage. Pick your vibe: speed or bandwidth. 🌐

Scope: Global / Server / Model.

parallel_jobs

Controls the number of parallel workers used to copy files during backup or recovery. It must be a positive integer. Default is 1.

Note: Applies only when backup_method = rsync.

Scope: Global / Server / Model.

parallel_jobs_start_batch_period

Specifies the time interval in seconds over which a single batch of parallel jobs will start. Default is 1 second. So like, if parallel_jobs_start_batch_size is 10 and parallel_jobs_start_batch_period is 1, that yields an effective rate limit of 10 jobs per second β€” because there's a max of 10 jobs that can be started within 1 second.

Note: Applies only when backup_method = rsync.

Scope: Global / Server / Model.

parallel_jobs_start_batch_size

Defines the maximum number of parallel jobs to start in a single batch. Default is 10 jobs. So if parallel_jobs_start_batch_size is 10 and parallel_jobs_start_batch_period is 2, that gives you a maximum of 10 jobs that can be started within 2 seconds.

Note: Applies only when backup_method = rsync.

Scope: Global / Server / Model.

path_prefix πŸ›£οΈ

Lists one or more absolute paths, separated by colons, where Barman looks for executable files β€” stuff like PostgreSQL binaries (from the appropriate bin directory for the PG_MAJOR_VERSION), rsync, encryption, and compression tools. These paths get prepended to the PATH environment variable and are checked before any others.

Scope: Global / Server / Model.

primary_checkpoint_timeout ⏰

Time to wait for new WAL files before forcing a checkpoint on the primary server. Defaults to 0.

Scope: Server / Model.

primary_conninfo

Connection string for Barman to connect to the primary Postgres server during a standby backup.

Note: Multi-host connection strings are not supported. See conninfo for details.

Scope: Server / Model.

primary_ssh_command

SSH command for connecting to the primary Barman server if Barman is passive.

Scope: Global / Server / Model.

slot_name

Replication slot name for the receive-wal command when streaming_archiver is enabled.

Scope: Global / Server / Model.

ssh_command

SSH command used by Barman to connect to the Postgres server for rsync backups.

Scope: Server / Model.

streaming_archiver 🌊

Enables Postgres' streaming protocol for WAL files. Defaults to false.

Note: If neither archiver nor streaming_archiver is configured, Barman will automatically set the archiver option to true to maintain compatibility with the previous default behavior, where archiving was enabled by default.

Scope: Global / Server / Model.

streaming_archiver_batch_size

Batch size for processing WAL files in streaming archiver. Defaults to 0.

Scope: Global / Server / Model.

streaming_archiver_name

Application name for the receive-wal command. Defaults to barman_receive_wal.

Scope: Global / Server / Model.

streaming_backup_name

Application name for the pg_basebackup command. Defaults to barman_streaming_backup.

Scope: Global / Server / Model.

streaming_conninfo

Connection string for streaming replication protocol. Defaults to conninfo.

Note: Multi-host connection strings are not supported. See conninfo for details.

Scope: Server / Model.

tablespace_bandwidth_limit

Maximum transfer rate for specific tablespaces for backup and recovery operations. A value of 0 indicates no limit (default).

Note: Applies only when backup_method = rsync.

Scope: Global / Server / Model.


πŸŽ€ Backups πŸŽ€

These configuration options are all about how Barman actually executes backups. Buckle up, bestie. 🫢

autogenerate_manifest

This is a boolean option that allows for the automatic creation of backup manifest files. The manifest file, which is a JSON document, lists all files included in the backup. It's generated upon completion of the backup and saved in the backup directory. The format of the manifest file adheres to the specifications outlined in the backup manifest format at https://www.postgresql.org/docs/current/backup-manifest-format.html in the PostgreSQL documentation, and it's compatible with the pg_verifybackup tool. Default is false.

Note: This option is ignored if the backup_method is not rsync.

Scope: Global / Server / Model.

backup_compression πŸ—œοΈ

Specifies the compression method for the backup process. It can be set to gzip, lz4, zstd, or none. Make sure the CLI tool for whichever compression method you pick is available on both the Barman and Postgres servers.

Note: Note that lz4 and zstd require Postgres version 15 or later. Unsetting this option or using none results in an uncompressed archive (default). Only supported when backup_method = postgres.

Scope: Global / Server / Model.

backup_compression_format

Determines the format pg_basebackup should use when saving compressed backups. Options are plain or tar, with tar as the default if unset. The plain format is available only if Postgres version 15 or later is in use and backup_compression_location is set to server.

Note: Only supported when backup_method = postgres.

Scope: Global / Server / Model.

backup_compression_level

Defines the level of compression for backups as an integer. The permissible values depend on the compression method specified in backup_compression.

Note: Only supported when backup_method = postgres.

Scope: Global / Server / Model.

backup_compression_location πŸ“

Specifies where compression should occur during the backup: either client or server. The server option is available only if Postgres version 15 or later is being used.

Note: Only supported when backup_method = postgres.

Scope: Global / Server / Model.

backup_compression_workers

Sets the number of threads used for compression during the backup process. This is applicable only when backup_compression=zstd. The default value is 0, which uses the standard compression behavior.

Note: Only supported when backup_method = postgres.

Scope: Global / Server / Model.

warehousepg_dbid

Specifies the integer identifier for a WarehousePG database. When set, this value is passed to pg_basebackup via the --target-gp-dbid parameter for WarehousePG compatibility. This option is required when backing up WarehousePG segments.

Important: This option is only relevant for WarehousePG databases and should not be set for standard PostgreSQL databases. Furthermore, Barman does not handle backups and restores for WarehousePG clusters. The orchestration of backup and restore operations for WarehousePG clusters must be managed externally by the user. πŸ’€
Note: Only supported when backup_method = postgres.

Scope: Global / Server / Model.

backup_directory

Specifies the directory where backup data for a server will be stored. Defaults to <barman_home>/<server_name>.

Scope: Server.

backup_method

Defines the method Barman uses to perform backups. Options include:

  • rsync (default): Executes backups using the rsync command over SSH (requires ssh_command).
  • postgres: Uses the pg_basebackup command for backups.
  • local-rsync: Assumes Barman runs on the same server and as the same user as the Postgres database, performing an rsync file system copy.
  • snapshot: Utilizes the API of the cloud provider specified in the snapshot_provider option to create disk snapshots as defined in snapshot_disks and saves only the backup label and metadata to its own storage.

Scope: Global / Server / Model.

backup_options

Controls how Barman interacts with Postgres during backups. This is a comma-separated list that can include:

  • concurrent_backup (default): Uses concurrent backup, recommended for Postgres versions 9.6 and later, and supports backups from standby servers.
  • exclusive_backup: Uses the deprecated exclusive backup method. Only for Postgres versions older than 15. This option will be removed in the future.
  • external_configuration: Suppresses warnings about external configuration files during backup execution.
Note: exclusive_backup and concurrent_backup cannot be used together.

Scope: Global / Server / Model.

basebackups_directory ☁️

Destination for base backup files. It can be a local path if storing backups locally, or a cloud storage URL if streaming backups to the cloud as described in Streaming backups to the cloud <#backup-streaming-backup-cloud>. Defaults to <backup_directory>/base.

Warning: Changing the value of basebackups_directory on an active server is discouraged. Even if done with care β€” by deactivating the server, moving existing data to the new location, and reactivating it β€” there are potential risks of data loss or misconfiguration. 😭 Please be careful, fr fr.

Scope: Server.

Instead, the safe move is to spin up a brand-new server config with the new value for basebackups_directory, run a fresh full backup onto that new server, and then decommission the old one once the new one is fully up and running.

Scope: Server.


basebackup_retry_sleep 😴

How many seconds do we vibe-check after a failed base backup copy before we try again? Default is 30 seconds. Has to be a non-negative integer, no cap.

Note: This applies to both backup and recovery operations.

Scope: Global / Server / Model.


basebackup_retry_times πŸ”

How many times we're willing to retry a base backup copy after an error pops off. Default is 0, which means no retries at all β€” we simply move on. Has to be a non-negative integer.

Note: This applies to both backup and recovery operations.

Scope: Global / Server / Model.


reuse_backup 🧬

Controls incremental backup support when you're rolling with backup_method=rsync, by reusing the last available backup. The options are:

  • off (default): Standard full backup, nothing fancy.
  • copy: File-level incremental backup, reusing the last backup for a server and creating a copy of the unchanged files (this is just for backup time reduction).
  • link: File-level incremental backup, reusing the last backup for a server and creating a hard link of the unchanged files (this one gets you both backup space and time reduction).
Note: This option will be ignored when backup_method=postgres.

Scope: Global / Server / Model.


worm_mode πŸͺ±

If you set it to on, it enables support for WORM (Write Once Read Many) storage, so Barman can handle backups on immutable storage correctly. Default is off.

Scope: Global / Server / Model.


☁️ Cloud Backups ☁️

These configuration options are all about how Barman executes backups up in the cloud. Buckle up bestie, there's a lot.


aws_await_snapshots_timeout ⏳

Specifies how long, in seconds, to wait for AWS snapshots to be created before a timeout hits. The default value is 3600 seconds. This must be a positive integer.

Note: Only supported when backup_method = snapshot and snapshot_provider = aws.

Scope: Global / Server / Model.


aws_profile πŸͺͺ

The name of the AWS profile to use when authenticating with AWS (think the INI section in your AWS credentials file).

Note: Only supported when backup_method = snapshot and snapshot_provider = aws, or when backup_method is postgres or local-to-cloud and basebackups_directory and/or wals_directory point to S3.

Scope: Global / Server / Model.


aws_region 🌍

When you're using backup_method = snapshot, this tells Barman the AWS region where the EC2 VM and storage volumes live β€” the ones defined by snapshot_instance and snapshot_disks.

When you're using backup_method = postgres or local-to-cloud pointing at S3, it tells Barman the AWS region where the S3 bucket lives.

Note: Only supported when backup_method = snapshot and snapshot_provider = aws, or when backup_method is postgres or local-to-cloud and basebackups_directory and/or wals_directory point to S3.

Scope: Global / Server / Model.


aws_check_object_lock πŸ”’

Set this to true and Barman will check for S3 Object Lock before it attempts to delete base backup files from S3 storage. If an object is locked, the deletion gets aborted, periodt. Defaults to false.

Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory points to S3. If enabled with a non-S3 provider, a warning will be logged and no lock checks will be performed.

Scope: Global / Server / Model.


aws_encryption πŸ”

Specifies the server-side encryption algorithm to use when storing objects in S3. This value gets passed straight to the S3 client for all upload operations to cloud object storage.

Allowed options:

  • AES256: Use S3-managed encryption keys (SSE-S3).
  • aws:kms: Use AWS Key Management Service encryption keys (SSE-KMS).

If you don't set it, S3's default encryption settings for the bucket will be used.

Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory and/or wals_directory point to S3.

Scope: Global / Server / Model.


aws_sse_kms_key_id πŸ—οΈ

Specifies the AWS Key Management Service (KMS) key ID to use for server-side encryption of S3 objects. This option is only valid when aws_encryption is set to aws:kms.

You can give it the key ID on its own, or the full ARN for the key. Either slaps.

If you don't set it while using aws_encryption = aws:kms, S3 will fall back to the default AWS managed KMS key for S3.

Example:

[myserver]
backup_method = local-to-cloud
basebackups_directory = s3://my-bucket/barman/backups
aws_encryption = aws:kms
aws_sse_kms_key_id = arn:aws:kms:us-east-1:123456789012:key/abcd1234-5678-90ab-cdef-EXAMPLEKEY
Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory and/or wals_directory point to S3.

Scope: Global / Server / Model.


aws_sse_customer_key πŸ™ˆ

Specifies a customer-provided encryption key for AWS S3 SSE-C (Server-Side Encryption with Customer Keys). The value has to be a file:// URI pointing to a file containing a base64-encoded 256-bit (32-byte) key.

When it's set, Barman passes the key to boto3 for all upload and download operations, base backups and WAL files included. The same key must be provided for both backup and restore operations, no exceptions.

Cannot be used together with aws_encryption or aws_sse_kms_key_id. Pick a lane.

Example:

[myserver]
backup_method = local-to-cloud
basebackups_directory = s3://my-bucket/barman/backups
aws_sse_customer_key = file:///etc/barman/sse-c.b64
Important: All backups and WAL files for a given server must be encrypted with the same SSE-C key. Mixing SSE-C-encrypted and unencrypted objects, or using different keys across backups, will cause barman commands to fail when S3 rejects requests with a mismatched or missing key. 😭
Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory and/or wals_directory point to S3.

Scope: Global / Server / Model.


aws_read_timeout βŒ›

Specifies the read timeout in seconds for S3 operations when you're using cloud storage. This value is passed to the S3 client for all commands that interact with backup data on cloud object storage. If you don't set it, the default boto3 read timeout behavior applies.

This option is here for advanced and non-standard S3 workflows where the default timeout just isn't enough.

Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory and/or wals_directory point to S3.

Scope: Global / Server / Model.


aws_snapshot_lock_mode πŸ”

The lock mode for the snapshot. This is only valid if snapshot_instance and snapshot_disk are set.

Allowed options:

  • compliance.
  • governance.
Note: Only supported when backup_method = snapshot and snapshot_provider = aws.

Scope: Global / Server / Model.


aws_snapshot_lock_duration πŸ•°οΈ

The lock duration is the period of time (in days) for which the snapshot is to remain locked, ranging from 1 to 36,500. Set either the lock duration or the expiration date β€” not both, bestie.

Note: Only supported when backup_method = snapshot and snapshot_provider = aws.

Scope: Global / Server / Model.


aws_snapshot_lock_cool_off_period 🧊

The cooling-off period is an optional period of time (in hours) that you can specify when you lock a snapshot in compliance mode, ranging from 1 to 72.

Note: Only supported when backup_method = snapshot and snapshot_provider = aws.

Scope: Global / Server / Model.


aws_snapshot_lock_expiration_date πŸ“…

The lock duration is determined by an expiration date in the future. It must be at least 1 day after the snapshot creation date and time, using the format YYYY-MM-DDTHH:MM:SS.sssZ. Set either the lock duration or the expiration date β€” not both.

Note: Only supported when backup_method = snapshot and snapshot_provider = aws.

Scope: Global / Server / Model.


azure_credential πŸ’ 

Specifies the type of Azure credential to use for authentication, either azure-cli, managed-identity or default. If you don't provide it, the default Azure authentication method will be used.

Note: Only supported when backup_method = snapshot and snapshot_provider = azure.

Scope: Global / Server / Model.


azure_resource_group πŸ—‚οΈ

Specifies the name of the Azure resource group containing the compute instance and disks defined by snapshot_instance and snapshot_disks.

Note: Only supported when backup_method = snapshot and snapshot_provider = azure.

Scope: Global / Server / Model.


azure_subscription_id πŸ†”

Identifies the Azure subscription that owns the instance and storage volumes defined by snapshot_instance and snapshot_disks.

Note: Only supported when backup_method = snapshot and snapshot_provider = azure.

Scope: Global / Server / Model.


cloud_delete_batch_size πŸ—‘οΈ

Specifies the number of files to delete in a single batch when performing delete operations on cloud storage. This one's relevant for both backup and WAL file deletions. The default value is 1000 for S3, 256 for Azure Blob, and 100 for GCS.

Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory and/or wals_directory point to cloud storage.

Scope: Global / Server / Model.


cloud_upload_max_archive_size πŸ“¦

Specifies the maximum size in bytes for individual archive files during cloud uploads. When uploading backups to cloud storage, Barman splits the backup into multiple archive files if it exceeds this size. The default value is 100Gi.

The accepted format is n{k|Ki|M|Mi|G|Gi|T|Ti} and it's 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 follow the same reasoning for greater units of measure.

Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory points to cloud storage.

Scope: Global / Server / Model.


cloud_upload_min_chunk_size 🧩

Specifies the minimum size in bytes for individual chunks during multipart uploads to cloud storage. This controls the size of each part when uploading large files to cloud object storage. When it's not set, it defaults to the chunk size of the cloud provider: 5Mi for S3, and 64Ki for Azure Blob. Not applicable for GCS, sorry GCS girlies.

The accepted format is n{k|Ki|M|Mi|G|Gi|T|Ti} and yes bestie it is 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. πŸ’…

Note: Only supported when backup_method is postgres or local-to-cloud, and basebackups_directory points to cloud storage.

cloud_staging_directory

A staging directory for when you're yeeting backups to a cloud object storage using backup_method = postgres. Barman uses it as a temporary little hangout spot for storing chunks of the backup before they get sent up to the cloud. Defaults to /tmp/barman/cloud-staging. πŸŽ€

Scope: Global / Server / Model.


cloud_staging_max_size

The maximum size that cloud_staging_directory can grow to before Barman stops generating new backup chunks. This exists so the staging directory doesn't just balloon forever in case the speed of uploading chunks can't 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. ✨

Scope: Global / Server / Model.


gcp_project

Specifies the ID of the GCP project that owns the instance and storage volumes defined by snapshot_instance and snapshot_disks. πŸ¦‹

Note: Only supported when backup_method = snapshot and snapshot_provider = gcp.

Scope: Global / Server / Model.


gcp_zone

Tells Barman the availability zone where the compute instance and disks are located, for snapshot backups. 🌸

Note: Only supported when backup_method = snapshot and snapshot_provider = gcp.

Scope: Server / Model.


snapshot_disks

This one is a comma-separated list of disks to include in cloud snapshot backups. πŸ“‹

Note: Required when backup_method = snapshot. Ensure that the snapshot_disks list includes all disks that store Postgres data, as any data not on these listed disks will not be included in the backup and will be unavailable during recovery. πŸ’€

Scope: Server / Model.


snapshot_instance

The name of the VM or compute instance where the storage volumes are attached. πŸ–₯️

Note: Required when backup_method = snapshot.

Scope: Server / Model.


snapshot_provider

The name of the cloud provider to use for creating snapshots. Supported value: aws, azure and gcp. 🌈

Note: Required when backup_method = snapshot.

Scope: Global / Server / Model.


🌸 Hook Scripts 🌸

These configuration options are all about the pre or post execution of hook scripts. Think of them as the little rituals that happen before and after the main event. πŸ’…


post_archive_retry_script

Specifies a hook script to run after a WAL file is archived. Barman will retry this script until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). In a post-archive scenario, ABORT_STOP has the same effect as ABORT_CONTINUE. πŸ‘‘

Scope: Global / Server.


post_archive_script

Specifies a hook script to run after a WAL file is archived, following the post_archive_retry_script. πŸŽ€

Scope: Global / Server.


post_backup_retry_script

Specifies a hook script to run after a base backup. Barman will retry this script until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). In a post-backup scenario, ABORT_STOP has the same effect as ABORT_CONTINUE. ✨

Scope: Global / Server.


post_backup_script

Specifies a hook script to run after a base backup, following the post_backup_retry_script. 🫢

Scope: Global / Server.


post_delete_retry_script

Specifies a hook script to run after deleting a backup. Barman will retry this script until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). In a post-delete scenario, ABORT_STOP has the same effect as ABORT_CONTINUE. 🌸

Scope: Global / Server.


post_delete_script

Specifies a hook script to run after deleting a backup, following the post_delete_retry_script. πŸ¦‹

Scope: Global / Server.


post_recovery_retry_script

Specifies a hook script to run after a recovery. Barman will retry this script until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). In a post-recovery scenario, ABORT_STOP has the same effect as ABORT_CONTINUE. πŸ’œ

Scope: Global / Server.


post_recovery_script

Specifies a hook script to run after a recovery, following the post_recovery_retry_script. ⭐

Scope: Global / Server.


post_wal_delete_retry_script

Specifies a hook script to run after deleting a WAL file. Barman will retry this script until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). In a post-WAL-delete scenario, ABORT_STOP has the same effect as ABORT_CONTINUE. πŸ”₯

Scope: Global / Server.


post_wal_delete_script

Specifies a hook script to run after deleting a WAL file, following the post_wal_delete_retry_script. πŸŽ€

Scope: Global / Server.


pre_archive_retry_script

Specifies a hook script that runs before a WAL file is archived during maintenance, following the pre_archive_script. As a retry hook script, Barman will repeatedly execute the script until it returns either SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). Returning ABORT_STOP will escalate the failure and halt the WAL archiving process. 😭

Scope: Global / Server.


pre_archive_script

Specifies a hook script launched before a WAL file is archived by maintenance. ✨

Scope: Global / Server.


pre_backup_retry_script

Specifies a hook script that runs before a base backup, following the pre_backup_script. As a retry hook script, Barman will attempt to execute the script repeatedly until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). Returning ABORT_STOP will escalate the failure and interrupt the backup process. πŸ’€

Scope: Global / Server.


pre_backup_script

Specifies a hook script to run before starting a base backup. 🫢

Scope: Global / Server.


pre_delete_retry_script

Specifies a retry hook script to run before backup deletion, following the pre_delete_script. As a retry hook script, Barman will attempt to execute the script repeatedly until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). Returning ABORT_STOP will escalate the failure and interrupt the backup deletion. πŸ™ˆ

Scope: Global / Server.


pre_delete_script

Specifies a hook script run before deleting a backup. 🌸

Scope: Global / Server.


pre_recovery_retry_script

Specifies a retry hook script to run before recovery, following the pre_recovery_script. As a retry hook script, Barman will attempt to execute the script repeatedly until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). Returning ABORT_STOP will escalate the failure and interrupt the recover process. 😭

Scope: Global / Server.


pre_recovery_script

Specifies a hook script run before starting a recovery. πŸ¦‹

Scope: Global / Server.


pre_wal_delete_retry_script

Specifies a retry hook script for WAL file deletion, executed before pre_wal_delete_script. As a retry hook script, Barman will attempt to execute the script repeatedly until it returns SUCCESS (0), ABORT_CONTINUE (62), or ABORT_STOP (63). Returning ABORT_STOP will escalate the failure and interrupt the WAL file deletion. πŸ”₯

Scope: Global / Server.


pre_wal_delete_script

Specifies a hook script run before deleting a WAL file. πŸ’œ

Scope: Global / Server.


🌈 Write-Ahead Logs (WAL) 🌈

These configuration options are related to how Barman will manage the Write-Ahead Logs (WALs) of the PostgreSQL servers. the WALs are the moment, no cap πŸ‘‘


compression

Specifies the standard compression algorithm for WAL files. Options include: lz4, xz, zstd, gzip, pygzip, pigz, bzip2, pybzip2, snappy and custom. πŸŽ€

Deprecated since version 3.16: The pygzip and pybzip2 compression options are deprecated and will be removed in a future release. Use their equivalents gzip and bzip2 instead.
Deprecated since version 3.17: The custom compression option and related configuration options (custom_compression_filter, custom_decompression_filter, and custom_compression_magic) are deprecated and will be removed in a future release. Use one of the built-in compression algorithms instead.
Note: All of these options require the module to be installed in the location where the compression will occur. The custom option is for custom compression, which requires you to set the following options as well: - custom_compression_filter: a compression filter. 🧚 - custom_decompression_filter: a decompression filter. 🧚 - custom_compression_magic: a hex string to identify a custom compressed wal file. 🧚

Scope: Global / Server / Model.

Deprecated since version 3.17: This configuration option is deprecated and will be removed in a future release.

custom_compression_filter

Specifies a custom compression algorithm for WAL files. It must be a string that will be used internally to create a bash command, and it will prefix to the following string > "$2" < "$1";. Write to standard output and do not delete input files. πŸ’…

Tip: bash custom_compression_filter = "xz -c" This is the same as running xz -c > "$2" < "$1";.

Scope: Global / Server / Model.

Deprecated since version 3.17: This configuration option is deprecated and will be removed in a future release.

custom_compression_magic

Defines a custom magic value to identify the custom compression algorithm used in WAL files. If this is set, Barman will avoid applying custom compression to WALs that have already been compressed with the specified algorithm. If not configured, Barman will apply custom compression to all WAL files, even those pre-compressed. ✨

Tip: For example, in the xz compression algorithm, the magic number is used to detect the format of .xz files. For xz files, the magic number is the following sequence of bytes: text Magic Number: FD 37 7A 58 5A 00 In hexadecimal representation, this can be expressed as: text Hex String: fd377a585a00 As Barman expects the value of custom_compression_magic to be prefixed with 0x, you would need to set that config option like this: text custom_compression_magic = 0xfd377a585a00 Reference: xz-file-format β€” https://tukaani.org/xz/xz-file-format-1.0.4.txt πŸ¦‹

Scope: Global / Server / Model.

Deprecated since version 3.17: This configuration option is deprecated and will be removed in a future release.

Okay so that was the last option's vibe check. Now let's get into the next one! πŸ’…

  • custom_decompression_filter β€” bestie, this one lets you specify a custom decompression algorithm for compressed WAL files. It has to be a string that Barman will use internally to create a bash command, and it gets prefixed to the following string: > "$2" < "$1";. So it must match the compression algorithm you used. No cap.
Tip: πŸŽ€ custom_compression_filter = "xz -c -d" This is the same as running xz -c -d > "$2" < "$1";.

Scope: Global / Server / Model.

  • compression_level β€” this specifies the compression level for the chosen compression algorithm. Valid values are integers within the algorithm's supported range, or one of these iconic predefined labels: low, medium, and high. They're just shortcuts, periodt.
    • low: uses low level of compression, favoring compression speed over compression ratio. πŸƒβ€β™€οΈπŸ’¨
    • medium: uses a medium level of compression, balancing between compression speed and compression ratio. βš–οΈ
    • high: uses a high level of compression, favoring compression ratio over compression speed. πŸ’πŸ’Ž

Predefined labels map to algorithm-specific levels, as detailed below:

Compression levels

  • lz4 β€” level range: 0 to 16; low: 0, medium: 6, high: 10
  • xz β€” level range: 1 to 9; low: 1, medium: 3, high: 5
  • zstd β€” level range: -22 to 22; low: 1, medium: 4, high: 9
  • gzip, pygzip, and pigz β€” level range: 1 to 9; low: 1, medium: 6, high: 9
  • bzip2 and pybzip2 β€” level range: 1 to 9; low: 1, medium: 5, high: 9

If the specified compression level is greater than the algorithm's maximum level, that maximum level is used. Similarly, if it is lower than the minimum level, that minimum level is used. The default value is medium. ✨

Scope: Global / Server / Model.

  • cloud_wal_archive_parallel β€” controls how many WAL files barman cloud-wal-archive will upload in parallel. When set to N (where N > 1), up to N - 1 additional WAL files that are ready in pg_wal/archive_status are uploaded concurrently in background processes after the primary WAL has been successfully archived. Defaults to 0 (disabled). πŸ”₯
Note: This option only applies when using the local-to-cloud backup method with barman cloud-wal-archive as the archive_command.

Scope: Global / Server.

  • incoming_wals_directory β€” specifies the directory where incoming WAL files are archived. Requires archiver to be enabled. Defaults to <backup_directory>/incoming. πŸ“

Scope: Server.

  • last_wal_maximum_age β€” defines the time frame within which the latest archived WAL file must fall. If the latest WAL file is older than this period, the barman check command will report an error. If left empty (default), the age of the WAL files is not checked. Format is the same as last_backup_maximum_age. ⏳

Scope: Global / Server / Model.

  • max_incoming_wals_queue β€” defines the maximum number of WAL files allowed in the incoming queue (including both streaming and archiving pools) before the barman check command returns an error. Default is None (disabled). 🚫

Scope: Global / Server / Model.

  • streaming_wals_directory β€” directory for streaming WAL files. Defaults to <backup_directory>/streaming. 🌊
Note: This option is applicable when streaming_archiver is activated.

Scope: Server.

  • wal_conninfo β€” the wal_conninfo connection string is used by Barman for monitoring the status of the replication slot receiving WALs. If specified, it takes precedence over wal_streaming_conninfo for these checks. If wal_conninfo is not set but wal_streaming_conninfo is, wal_conninfo will fall back to wal_streaming_conninfo. If neither wal_conninfo nor wal_streaming_conninfo is set, wal_conninfo will fall back to conninfo. Both connection strings must access a Postgres instance within the same cluster as defined by streaming_conninfo and conninfo. If both wal_conninfo and wal_streaming_conninfo are set, only wal_conninfo needs the appropriate permissions to read settings and check the replication slot status. However, if only wal_streaming_conninfo is set, it must have the necessary permissions to perform these tasks. The required permissions include roles such as pg_monitor, both pg_read_all_settings and pg_read_all_stats, or superuser privileges. πŸ”

Scope: Server / Model.

  • wal_streaming_conninfo β€” this connection string is used by Barman to connect to the Postgres server for receiving WAL segments via streaming replication and checking the replication slot status, if wal_conninfo is not set. If not specified, Barman defaults to using streaming_conninfo for these tasks. wal_streaming_conninfo must connect to a Postgres instance within the same cluster as defined by streaming_conninfo, and it must support streaming replication. If both wal_streaming_conninfo and wal_conninfo are set, only wal_conninfo needs the required permissions to read settings and check the replication slot status. If only wal_streaming_conninfo is specified, it must have these permissions. The necessary permissions include roles such as pg_monitor, both pg_read_all_settings and pg_read_all_stats, or superuser privileges. πŸ”‘

Scope: Server / Model.

  • wals_directory β€” destination for archived WAL files. It can be a local path if storing WAL files locally, or a cloud storage URL if storing WAL files in the cloud as described in Streaming backups to the cloud <# backup-streaming-backup-cloud>. Defaults to <backup_directory>/wals. ☁️
Warning: Changing the value of wals_directory on an active server is discouraged. Even if done with care, by deactivating the server, moving existing data to the new location, and reactivating it, there are potential risks of data loss or misconfiguration. Instead, the safe option is to create a new server configuration with the new value for wals_directory, perform a new full backup to the new server, and then decommission the old server once the new one is fully operational.

Scope: Server.

  • xlogdb_directory β€” a custom directory for the SERVER-xlog.db file, SERVER being the server name. This file stores metadata of archived WAL files and is used internally by Barman. If unset, it defaults to the value of wals_directory. πŸ—„οΈ

Scope: Global / Server.


Restore 🌈

These configuration options are related to how Barman manages restoration backups. Let's get into it!

  • local_staging_path β€” specifies the local path for combining block-level incremental backups during recovery. This location must have sufficient space to temporarily store the new synthetic backup. Required for recovery from a block-level incremental backup. πŸ“¦
Note: Applies only when backup_method = postgres.

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.

Scope: Global / Server / Model.

  • recovery_options β€” options for recovery operations. Currently, only get-wal and delta-restore are supported. get-wal enables the creation of a basic restore_command in the recovery configuration, which uses the barman get-wal command to retrieve WAL files directly from Barman's WAL archive. delta-restore allows barman to restore a backup into a pre-existing destination directory along with existing custom tablespaces by overwriting it. This setting accepts a comma-separated list of values and defaults to empty. πŸ› οΈ

Scope: Global / Server / Model.

  • recovery_staging_path β€” specifies the path on the recovery host for staging files from compressed backups. This location must have sufficient space to temporarily store the compressed backup. πŸ—‚οΈ
Note: Applies only for compressed backups.

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.

Scope: Global / Server / Model.

  • staging_path β€” a path where intermediate files are staged during restore. When restoring a compressed backup, it serves as a temporary location for decompression before copying to the final destination. When restoring an incremental backup, it is where backups are combined before copying to the final destination. This location must have enough space to store the decompressed/combined backup. The default is /tmp. πŸ“‚

Scope: Global / Server / Model.

  • staging_location β€” specifies whether staging_path is a local or remote path. Valid values are local and remote. The default is local. 🏠

Scope: Global / Server / Model.

  • combine_mode β€” specifies a copy mode for pg_combinebackup when combining incremental backups during a restore. 🧩

Options include:

  • copy (default): Use standard file copying when combining incremental backups.
  • link: Use hard links when combining incremental backups. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space.
  • 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.
  • 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.

Scope: Global / Server / Model.

Refer to the pg_combinebackup documentation https://www.postgresql.org/docs/current/app-pgcombinebackup.html for more details and restrictions of each mode. 🫢

Scope: Global / Server / Model.

πŸŽ€ Retention Policies πŸŽ€

okay bestie these config options are all about how Barman handles retention policies for your backups β€” like, how long stuff sticks around before it gets yeeted. πŸ’…

last_backup_maximum_age

This one defines the time frame within which the latest backup must fall. If the latest backup is older than this period, the barman check command will report an error. 😭 If you leave it empty (that's the default), the latest backup is always considered valid. The accepted format is "n {DAYS|WEEKS|MONTHS|HOURS}", where n is an integer greater than zero.

Scope: Global / Server / Model.

last_backup_minimum_size

Specifies the minimum acceptable size for the latest successful backup. If the latest backup is smaller than this size, barman check will report an error. πŸ’€ If left empty (default), the latest backup is always considered valid. The accepted format is "n{k|Ki|M|Mi|G|Gi|T|Ti}" and it's 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 follow the same reasoning for greater units of measure. 🧚

Scope: Global / Server / Model.

retention_policy

Defines how long backups and WAL files should be retained. If this option is left blank, no retention policies will be applied. Options include redundancy and recovery window policies.

retention_policy = {REDUNDANCY value | RECOVERY WINDOW OF value {DAYS | WEEKS | MONTHS}}
  • retention_policy = REDUNDANCY 2 will keep only 2 backups in the backup catalog, automatically deleting the older one as new backups are created. The number must be a positive integer. ✨
  • retention_policy = RECOVERY WINDOW OF 2 DAYS will only keep backups needed to recover to any point in time in the last two days, automatically deleting backups that are older. The period number must be a positive integer, and the following options can be applied to it: DAYS, WEEKS, MONTHS.

Scope: Global / Server / Model.

retention_policy_mode

Mode for enforcing retention policies. Currently only supports auto. That's it, that's the whole vibe. πŸ™ˆ

Scope: Global / Server / Model.

wal_retention_policy

Policy for retaining WAL files. Currently only main is available.

Scope: Global / Server / Model.


πŸ‘‘ CONFIGURATION MODELS πŸ‘‘

Configuration models provide a systematic approach to manage and apply configuration overrides for Postgres servers by organizing them under a specific cluster name. Lowkey genius fr fr. πŸ’–

Purpose

The primary goal of a configuration model is to simplify the management of configuration settings for Postgres servers grouped by the same cluster. By using a model, you can apply a set of common configuration overrides, enhancing operational efficiency. They are especially beneficial in clustered environments, allowing you to create various configuration models that can be utilized during failover events. 🌈

Application

The configurations defined in a model file can be applied to Postgres servers that share the same cluster name specified in the model. Consequently, any server utilizing that model can inherit these settings, promoting a consistent and adaptable configuration across all servers. Consistency? We love her. πŸ’…

Usage

Model options can only be defined within a model section, which is identified in the same way as a server section. It is important to ensure that there are no conflicts between the identifiers of server sections and model sections. 🚨

To apply a configuration model, execute the barman config-switch SERVER_NAME MODEL_NAME. This command facilitates the application of the model's overrides to the relevant Postgres server associated with the specified cluster name.

If you wish to remove the overrides, the deletion of the model configuration file alone will not have any effect, so you can do so by using the --reset argument with the command, as follows: barman config-switch SERVER_NAME --reset.

Note: πŸŽ€ The config-switch command will only succeed if model name exists and is associated with the same cluster as the server. Additionally, there can be only one active model at a time; if you execute the command multiple times with different models, only the overrides defined in the last model will be applied. Not all options can be configured through models. Please review the scope of the available configurations to determine which settings apply to models.

Benefits

  • Consistency: Ensures uniform configuration across multiple Postgres servers within a cluster.
  • Efficiency: Simplifies configuration management by allowing centralized updates and overrides.
  • Flexibility: Allows the use of multiple model files, providing the ability to define various sets of overrides as necessary.

πŸ’œ Author πŸ’œ

EnterpriseDB

Β© Copyright EnterpriseDB UK Limited 2011-2026


okay that's the whole page bestie, we made it πŸŽ‰ this was version 3.20 of the Barman docs, dated Sep 29, 2026 β€” go configure something iconic, you got this πŸ‘‘πŸ’–

πŸ“¦ where this page comes from