SYNOPSIS

barman [OPTIONS] {COMMAND}

DESCRIPTION

barman(1) is an administration tool for disaster recovery of PostgreSQL servers written in Python. barman can perform remote backups of multiple servers in business critical environments and helps DBAs during the recovery phase.

OPTIONS

-v, --version

Show program version number and exit.

-q, --quiet

Do not output anything. Useful for cron scripts.

-h, --help

Show a help message and exit.

-c CONFIG, --config CONFIG

Use the specified configuration file.

WHERE COMMAND CAN BE:

Important: every command has an help option

cron

Perform maintenance tasks, such as moving incoming WAL files to the appropriate directory.

list-server

Show all the configured servers, and their descriptions.

show-server SERVERNAME

Show information about SERVERNAME, including: conninfo, backup_directory, wals_directory and many more. Specify all as SERVERNAME to show information about all the configured servers.

status SERVERNAME

Show information about the status of a server, including: number of available backups, archive_command, archive_status and many more.

Example:
Server main:
  description: PostgreSQL Example Database
  PostgreSQL version: 9.1.1
  PostgreSQL Data directory: /var/lib/pgsql/9.1/data
  archive_command: rsync -a %p barman@test-backup-server:/srv/barman/main/incoming/%f
  archive_status: last shipped WAL segment 0000000100000009000000ED
  current_xlog: 0000000100000009000000EF
  No. of available backups: 1
  first/last available backup: 20120528T113358

check SERVERNAME

Show diagnostic information about SERVERNAME, including: ssh connection check, PostgreSQL version, configuration and backup directories. Specify all as SERVERNAME to show diagnostic information about all the configured servers.

--nagios

Nagios plugin compatible output

diagnose

Collect diagnostic information about the server where barman is installed and all the configured servers, including: global configuration, SSH version, Python version, rsync version, as well as current configuration and status of all servers.

backup SERVERNAME

Perform a backup of SERVERNAME using parameters specified in the configuration file. Specify all as SERVERNAME to perform a backup of all the configured servers.

--immediate-checkpoint

forces the initial checkpoint to be done as quickly as possible. Overrides value of the parameter immediate_checkpoint, if present in the configuration file.

--no-immediate-checkpoint

forces to wait for the checkpoint. Overrides value of the parameter immediate_checkpoint, if present in the configuration file.

--retry-times

Number of retries of data copy during base backup after an error. Overrides value of the parameter basebackup_retry_times, if present in the configuration file.

--no-retry

Same as --retry-times 0

--retry-sleep

Number of seconds of wait after a failed copy, before retrying. Overrides value of the parameter basebackup_retry_sleep, if present in the configuration file.

--no-immediate-checkpoint

Forces the number of retries of data copy to 0. Overrides value of the parameter basebackup_retry_times, if present in the configuration file.

list-backup SERVERNAME

Show available backups for SERVERNAME. This command is useful to retrieve a backup ID.

Example: servername 20111104T102647 - Fri Nov 4 10:26:48 2011 - Size: 17.0 MiB - WAL Size: 100 B

Here 20111104T102647 is the backup ID.

show-backup SERVERNAME BACKUPID

Show detailed information about a particular backup, identified by the server name and the backup ID. See the "Backup ID shortcuts" section below for available shortcuts.

Example:
Backup 20111104T102647:
  Server Name       : main
  PostgreSQL Version: 90101
  PGDATA directory  : /var/lib/pgsql/9.1/data
Base backup information:
  Disk usage      : 17.0 MiB
  Timeline        : 1
  Begin WAL       : 000000010000000000000002
  End WAL         : 000000010000000000000002
  WAL number      : 0
  Begin time      : 2011-11-04 10:26:47.357260
  End time        : 2011-11-04 10:26:48.888903
  Begin Offset    : 32
  End Offset      : 160
  Begin XLOG      : 0/2000020
  End XLOG        : 0/20000A0
WAL information:
  No of files     : 0
  Disk usage      : 0 B
  Last available  : None
Catalog information:
  Previous Backup : - (this is the oldest base backup)
  Next Backup     : - (this is the latest base backup)

list-files [OPTIONS] SERVERNAME BACKUPID

List all the files in a particular backup, identified by the server name and the backup ID. See the "Backup ID shortcuts" section below for available shortcuts.

--target TARGET_TYPE

Possible values for TARGET_TYPE are:

data - lists just the data files;

standalone - lists the base backup files, including required WAL files;

wal - lists all the WAL files between the start of the base backup and the end of the log / the start of the following base backup (depending on whether the specified base backup is the most recent one available);

full - same as data + wal. Defaults to standalone

rebuild-xlogdb SERVERNAME

Perform a rebuild of the WAL file metadata for SERVERNAME (or every server, using the all shortcut) guessing it from the disk content. The metadata of the WAL archive is contained in the xlog.db file, and every Barman server has its own copy.

recover [OPTIONS] SERVERNAME BACKUPID DESTINATIONDIRECTORY

Recover a backup in a given directory (local or remote, depending on the --remote-ssh-command option settings). See the "Backup ID shortcuts" section below for available shortcuts.

--target-tli TARGET_TLI

Recover the specified timeline.

--target-time TARGET_TIME

Recover to the specified time. You can use any valid unambiguous representation. e.g: "YYYY-MM-DD HH:MM:SS.mmm".

--target-xid TARGET_XID

Recover to the specified transaction ID.

--target-name TARGET_NAME

Recover to the named restore point previously created with the pg_create_restore_point(name) (for PostgreSQL 9.1 and above users).

--exclusive

Set target xid to be non inclusive.

--tablespace NAME:LOCATION

Specify tablespace relocation rule.

--remote-ssh-command SSH_COMMAND

This options activates remote recovery, by specifying the secure shell command to be launched on a remote host. This is the equivalent of the "ssh_command" server option in the configuration file for remote recovery. Example: ssh postgres@db2.

--retry-times

Number of retries of data copy during base backup after an error. Overrides value of the parameter basebackup_retry_times, if present in the configuration file.

--retry-sleep

Number of seconds of wait after a failed copy, before retrying. Overrides value of the parameter basebackup_retry_sleep, if present in the configuration file.

--no-immediate-checkpoint

Forces the number of retries of data copy to 0. Overrides value of the parameter basebackup_retry_times, if present in the configuration file.

delete SERVERNAME BACKUPID

Delete the specified backup. See the "Backup ID shortcuts" section below for available shortcuts.

BACKUP ID SHORTCUTS

Rather than using the timestamp backup ID, you can use any of the following shortcuts/aliases to identity a backup for a given server:

first

Oldest available backup for that server, in chronological order.

last

Latest available backup for that server, in chronological order.

latest

same ast last.

oldest

same ast first.

EXIT STATUS

0

Success

Not zero

Failure

BUGS

Barman has been extensively tested, and is currently being used in several production environments. However, we cannot exclude the presence of bugs.

Any bug can be reported via the Sourceforge bug tracker. Along the bug submission, users can provide developers with diagnostics information obtained through the barman diagnose command.

AUTHORS

In alphabetical order:

Gabriele Bartolini <[email protected]> (core team, project leader)

Giuseppe Broccolo <[email protected]> (core team, QA/testing)

Giulio Calacoci <[email protected]> (core team, developer)

Francesco Canovai <[email protected]> (core team, QA/testing)

Marco Nenciarini <[email protected]> (core team, team leader)

Past contributors:

Carlo Ascani

RESOURCES

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

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 © 2011-2014 2ndQuadrant Italia (Devise.IT S.r.l.) - http://www.2ndQuadrant.it/.