BARMAN(1)

NAME
barman - Backup and Recovery Manager for PostgreSQL

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

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.

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

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"

    --exclusive
        Set target xid to be non inclusive.

    --tablespace NAME:LOCATION
        Specify tablespace relocation rule (currently not available with remote recovery).

    --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.

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 live installation. All the reported bugs were fixed prior to the open source release, due to the particular nature of backup operations where data security is paramount. In particular, there are no known bugs at present. Any bug can be reported via the Sourceforge bug tracker.

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/.