GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BARMAN (5)

NAME

barman - backup and recovery manager for PostgreSQL

CONTENTS

Configuration File Locations
Configuration File Syntax
Configuration File Directory
Options
Hook Scripts
Example
See Also
Authors
Resources
Copying
Authors

CONFIGURATION FILE LOCATIONS

The system-level Barman configuration file is located at
C]
/usr/local/etc/barman.conf
]

or
C]
/usr/local/etc/barman/barman.conf
]

and is overridden on a per-user level by
C]
$HOME/.barman.conf
]

CONFIGURATION FILE SYNTAX

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

CONFIGURATION FILE DIRECTORY

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

OPTIONS

active When set to C]true] (default), the server is in full operational state. When set to C]false], the server can be used for diagnostics, but any operational command such as backup execution or WAL archiving is temporarily disabled. Setting C]active=false] is a good practice when adding a new node to Barman. Server.
archiver
  This option allows you to activate log file shipping through PostgreSQL[aq]s C]archive_command] for a server. If set to C]true] (default), Barman expects that continous archiving for a server is in place and will activate checks as well as management (including compression) of WAL files that Postgres deposits in the I]incoming] directory. Setting it to C]false], will disable standard continuous archiving for a server. Global/Server. (NOTE: this option is currently required to be enabled until Barman natively supports physical replication slots. Setting it to C]false] will result in a disabled server).
backup_directory
  Directory where backup data for a server will be placed. Server.
backup_method
  Configure the way barman executes a backup. Currently, only C]rsync]. Global/Server.
backup_options
  This option allows you to control the way Barman interacts with PostgreSQL for backups. If set to C]exclusive_backup] (default), C]barman backup] executes backup operations using the standard exclusive backup approach (technically through pg_start_backup/pg_stop_backup). If set to C]concurrent_backup], Barman requires the C]pgespresso] module to be installed on the PostgreSQL server (this allows you to perform a backup from a standby server). 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.
barman_home
  Main data directory for Barman. Global.
barman_lock_directory
  Directory for locks. Default: C]%(barman_home)s]. Global.
basebackups_directory
  Directory where base backups will be placed. Server.
basebackup_retry_sleep
  Number of seconds of wait after a failed copy, before retrying Used during both backup and recovery operations. Positive integer, default 30. Global/Server.
basebackup_retry_times
  Number of retries of base backup copy, after an error. Used during both backup and recovery operations. Positive integer, default 0. Global/Server.
compression
  Standard compression algorithm applied to WAL files. Possible values are: C]gzip] (requires C]gzip] to be installed on the system), C]bzip2] (requires C]bzip2]), C]pigz] (requires C]pigz]), C]pygzip] (Python[aq]s internal gzip compressor) and C]pybzip2] (Python[aq]s internal bzip2 compressor). Global/Server.
conninfo
  Connection string used by Barman to connect to the Postgres server. Server.
custom_compression_filter
  Customised compression algorithm applied to WAL files. Global/Server.
custom_decompression_filter
  Customised decompression algorithm applied to compressed WAL files; this must match the compression algorithm. Global/Server.
description
  A human readable description of a server. Server.
errors_directory
  Directory that contains WAL files that contain an error; usually this is related to a conflict with an existing WAL file (e.g. a WAL file that has been archived after a streamed one).
immediate_checkpoint
  This option allows you to control the way PostgreSQL handles checkpoint at the start of the backup. If set to C]false] (default), the I/O workload for the checkpoint will be limited, according to the C]checkpoint_completion_target] setting on the PostgreSQL server. If set to C]true], an immediate checkpoint will be requested, meaning that PostgreSQL will complete the checkpoint as soon as possible. Global/Server.
incoming_wals_directory
  Directory where incoming WAL files are archived into. Requires C]archiver] to be enabled. Server.
last_backup_maximum_age
  This option identifies a time frame that must contain the latest backup. If the latest backup is older than the time frame, barman check command will report an error to the user. If empty (default), latest backup is always considered valid. Syntax for this option is: "i (DAYS | WEEKS | MONTHS)" where i is a integer greater than zero, representing the number of days | weeks | months of the time frame. Global/Server.
log_file
  Location of Barman[aq]s log file. Global.
log_level
  Level of logging (DEBUG, INFO, WARNING, ERROR, CRITICAL). Global.
minimum_redundancy
  Minimum number of backups to be retained. Default 0. Global/Server.
network_compression
  This option allows you to enable data compression for network transfers. If set to C]false] (default), no compression is used. If set to C]true], compression is enabled, reducing network usage. Global/Server.
path_prefix
  One or more absolute paths, separated by colon, where Barman looks for executable files. The paths specified in C]path_prefix] are tried before the ones specified in C]PATH] environment variable. Global/server.
post_archive_retry_script
  Hook script launched after a WAL file is archived by maintenance. Being this a I]retry] hook script, Barman will retry the execution of the script until this either returns a SUCCESS (0), an ABORT_CONTINUE (62) or an ABORT_STOP (63) code. In a post archive scenario, ABORT_STOP has currently the same effects as ABORT_CONTINUE. Global/Server.
post_archive_script
  Hook script launched after a WAL file is archived by maintenance, after [aq]post_archive_retry_script[aq]. Global/Server.
post_backup_retry_script
  Hook script launched after a base backup. Being this a I]retry] hook script, Barman will retry the execution of the script until this either returns a SUCCESS (0), an ABORT_CONTINUE (62) or an ABORT_STOP (63) code. In a post backup scenario, ABORT_STOP has currently the same effects as ABORT_CONTINUE. Global/Server.
post_backup_script
  Hook script launched after a base backup, after [aq]post_backup_retry_script[aq]. Global/Server.
pre_archive_retry_script
  Hook script launched before a WAL file is archived by maintenance, after [aq]pre_archive_script[aq]. Being this a I]retry] hook script, Barman will retry the execution of the script until this either returns a SUCCESS (0), an ABORT_CONTINUE (62) or an ABORT_STOP (63) code. Returning ABORT_STOP will propagate the failure at a higher level and interrupt the WAL archiving operation. Global/Server.
pre_archive_script
  Hook script launched before a WAL file is archived by maintenance. Global/Server.
pre_backup_retry_script
  Hook script launched before a base backup, after [aq]pre_backup_script[aq]. Being this a I]retry] hook script, Barman will retry the execution of the script until this either returns a SUCCESS (0), an ABORT_CONTINUE (62) or an ABORT_STOP (63) code. Returning ABORT_STOP will propagate the failure at a higher level and interrupt the backup operation. Global/Server.
pre_backup_script
  Hook script launched before a base backup. Global/Server.
recovery_options
  Options for recovery operations. Currently only supports C]get-wal]. C]get-wal] activates generation of a basic C]restore_command] in the resulting C]recovery.conf] file that uses the C]barman get-wal] command to fetch WAL files directly from Barman[aq]s archive of WALs. Comma separated list of values, default empty. Global/Server.
retention_policy
  Policy for retention of periodic 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.
retention_policy_mode
  Currently only "auto" is implemented. Global/Server.
reuse_backup
  This option controls incremental backup support. Global/Server. Possible values are: * C]off]: disabled (default); * C]copy]: reuse the last available backup for a server and create a copy of the unchanged files (reduce backup time); * C]link]: reuse the last available backup for a server and create a hard link of the unchanged files (reduce backup time and space). Requires operating system and file system support for hard links.
streaming_archiver
  This option allows you to use the PostgreSQL[aq]s streaming protocol to receive transaction logs from a server. If set to C]on], Barman expects to find C]pg_receivexlog] in the PATH (see C]path] option) and that streaming connection for the server is working. This activates connection checks as well as management (including compression) of WAL files. If set to C]off] (default) barman will rely only on continuous archiving for a server WAL archive operations, eventually terminating any running C]pg_receivexlog] for the server. Global/Server.
streaming_conninfo
  Connection string used by Barman to connect to the Postgres server via streaming replication protocol. Server.
streaming_wals_directory
  Directory where WAL files are streamed from the PostgreSQL server to Barman. Requires C]streaming_archiver] to be enabled. Server.
ssh_command
  Command used by Barman to login to the Postgres server via ssh. 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.
wal_retention_policy
  Policy for retention of archive logs (WAL files). Currently only "MAIN" is available. Global/Server.
wals_directory
  Directory which contains WAL files. 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:
C]BARMAN_CONFIGURATION]
  configuration file used by barman
C]BARMAN_ERROR]
  error message, if any (only for the [aq]post[aq] phase)
C]BARMAN_PHASE]
  [aq]pre[aq] or [aq]post[aq]
C]BARMAN_RETRY]
  C]1] if it is a I]retry script] (from 1.5.0), C]0] if not
C]BARMAN_SERVER]
  name of the server
Backup scripts specific variables:
C]BARMAN_BACKUP_DIR]
  backup destination directory
C]BARMAN_BACKUP_ID]
  ID of the backup
C]BARMAN_PREVIOUS_ID]
  ID of the previous backup (if present)
C]BARMAN_STATUS]
  status of the backup
C]BARMAN_VERSION]
  version of Barman
Archive scripts specific variables:
C]BARMAN_SEGMENT]
  name of the WAL file
C]BARMAN_FILE]
  full path of the WAL file
C]BARMAN_SIZE]
  size of the WAL file
C]BARMAN_TIMESTAMP]
  WAL file timestamp
C]BARMAN_COMPRESSION]
  type of compression used for the WAL file
Only in case of retry hook scripts, the exit code of the script is checked by Barman. Output of hook scripts is simply written in the log file.

EXAMPLE

Here is an example of configuration file:
C]
[barman]
; Main directory
barman_home = /var/barman

; System user barman_user = barman

; Log location log_file = /var/log/barman/barman.log

; Default compression level ;compression = gzip

; Incremental backup reuse_backup = link

; [aq]main[aq] PostgreSQL Server configuration [main] ; Human readable description description = "Main PostgreSQL Database"

; SSH options ssh_command = ssh pgsql\@pg

; PostgreSQL connection string conninfo = host=pg user=pgsql db=postgres

; PostgreSQL streaming connection string streaming_conninfo = host=pg user=postgres

; Minimum number of required backups (redundancy) minimum_redundancy = 1

; Retention policy (based on redundancy) retention_policy = REDUNDANCY 2 ]

SEE ALSO

C]barman] (1).

AUTHORS

In alphabetical order:
[bu] Gabriele Bartolini <gabriele.bartolini@2ndquadrant.it> (project leader)
[bu] Stefano Bianucci <stefano.bianucci@2ndquadrant.it> (developer)
[bu] Giuseppe Broccolo <giuseppe.broccolo@2ndquadrant.it> (QA/testing)
[bu] Giulio Calacoci <giulio.calacoci@2ndquadrant.it> (developer)
[bu] Francesco Canovai <francesco.canovai@2ndquadrant.it> (QA/testing)
[bu] Leonardo Cecchi <leonardo.cecchi@2ndquadrant.it> (developer)
[bu] Gianni Ciolli <gianni.ciolli@2ndquadrant.it> (QA/testing)
[bu] Marco Nenciarini <marco.nenciarini@2ndquadrant.it> (lead developer)
Past contributors:
[bu] Carlo Ascani

RESOURCES

[bu] Homepage: <http://www.pgbarman.org/>
[bu] Documentation: <http://docs.pgbarman.org/>

COPYING

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

Copyright (C) 2011-2016 2ndQuadrant Italia Srl - http://www.2ndQuadrant.it/.

AUTHORS

2ndQuadrant Italy <http://www.2ndQuadrant.it>.
Search for    or go to Top of page |  Section 5 |  Main Index


Barman User manuals BARMAN (5) February 29, 2016

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.