BARMAN(5)

NAME
barman - backup and recovery manager for PostgreSQL

CONFIGURATION FILE LOCATIONS

The system-level Barman configuration file is located at

    /etc/barman.conf

or

    /etc/barman/barman.conf

and is overridden on a per-user level by

    $HOME/.barman.conf

CONFIGURATION FILE SYNTAX

The Barman configuration file is a plain ini file. There is a general section called [barman] and a section [servername] for each server you want to backup. Rows starting with ; are comments.

CONFIGURATION FILE DIRECTORY

Barman supports the inclusion of multiple configuration files, through the configuration_files_directory option. Included files must contain only server specifications, not global configurations. If the value of configuration_files_directory is a directory, Barman reads all files with .conf extension that exist in that folder. For example, if you set it to /etc/barman.d, you can specify your PostgreSQL servers placing each section in a separate .conf file inside the /etc/barman.d folder.

OPTIONS

active
    Ignored. Server.

description
    A human readable description of a server. Server.

ssh_command
    Command used by Barman to login to the Postgres server via ssh. Server.

conninfo
    Connection string used by Barman to connect to the Postgres server. Server.

basebackups_directory
    Directory where base backups will be placed. Global/Server.

wals_directory
    Directory which contains WAL files. Global/Server.

incoming_wals_directory
    Directory where incoming WAL files are archived into. Global/Server.

lock_file
    Lock file for a backup in progress. Global/Server.

compression_filter
    Compression algorithm applied to WAL files. Global/Server.

decompression_filter
    Decompression algorithm applied to compressed WAL files; this must match the compression algorithm. Global/Server.

pre_backup_script
    Hook script launched before a base backup. Global/Server.

post_backup_script
    Hook script launched after a base backup. Global/Server.

minimum_redundancy
    Minimum number of backups to be retained. Default 0. Global/Server.

retention_policy
    Policy for retention of periodical backups and archive logs. If left empty, retention policies are not enforced. For redundancy based retention policy use "REDUNDANCY i" (where i is an integer > 0 and defines the number of backups to retain). For recovery window retention policy use "RECOVERY WINDOW OF i DAYS" or "RECOVERY WINDOW OF i WEEKS" or "RECOVERY WINDOW OF i MONTHS" where i is a positive integer representing, specifically, the number of days, weeks or months to retain your backups. For more detailed information, refer to the official documentation. Default value is empty. Global/Server.

wal_retention_policy
    Policy for retention of archive logs (WAL files). Currently only "MAIN" is available. Global/Server.

retention_policy_mode
    Currently only "auto" is implemented. Global/Server.

bandwidth_limit
    This option allows you to specify a maximum transfer rate in kilobytes per second. A value of zero specifies no limit (default). Global/Server.

tablespace_bandwidth_limit
    This option allows you to specify a maximum transfer rate in kilobytes per second, by specifying a comma separated list of tablespaces (pairs TBNAME:BWLIMIT). A value of zero specifies no limit (default). Global/Server.

HOOK SCRIPTS

The script definition is passed to a shell and can return any exit code.

The shell environment will contain the following variables:

BARMAN_BACKUP_DIR
    backup destination directory

BARMAN_BACKUP_ID
    ID of the backup

BARMAN_CONFIGURATION
    configuration file used by barman

BARMAN_ERROR
    error message, if any (only for the post phase)

BARMAN_PHASE
    pre or post

BARMAN_PREVIOUS_ID
    ID of the previous backup (if present)

BARMAN_SERVER
    name of the server

BARMAN_STATUS
    status of the backup

BARMAN_VERSION
    version of Barman

No check is performed on the exit code of the script. The result will be simply written in the log file.

EXAMPLE

Example of the configuration file:

    [barman]
    ; Main directory
    barman_home = /var/lib/barman
    ; System user
    barman_user = barman
    ; Log location
    log_file = /var/log/barman/barman.log
    ; Default compression level
    ;compression = gzip
    ; 'main' PostgreSQL Server configuration
    [main]
    ; Human readable description
    description =  "Main PostgreSQL Database"
    ; SSH options
    ssh_command = ssh postgres@pg
    ; PostgreSQL connection string
    conninfo = host=pg user=postgres
    ; Minimum number of required backups (redundancy)
    minimum_redundancy = 1
    ; Retention policy (based on redundancy)
    retention_policy = REDUNDANCY 2

AUTHORS

In alphabetical order:

    • Carlo Ascani <carlo.ascani@2ndquadrant.it>

    • Gabriele Bartolini <gabriele.bartolini@2ndquadrant.it>

    • Marco Nenciarini <marco.nenciarini@2ndquadrant.it>

RESOURCES

Homepage: http://www.pgbarman.org/

COPYING

Barman is the exclusive property of 2ndQuadrant Italia and its code is distributed under GNU General Public License v3.

Copyright © 2011-2013, 2ndQuadrant Italia (Devise.IT S.r.l.) - http://www.2ndQuadrant.it/.