[barman]
barman_home = /var/lib/barman
barman_user = barman
log_file = /var/log/barman/barman.log
compression = gzip
reuse_backup = link
basebackup_retry_times = 3
basebackup_retry_sleep = 30
last_backup_maximum_age = 1 DAYS
[mycluster]
description = "My Cluster"
ssh_command = ssh postgres@myclusterip
conninfo = host=myclusterip user=postgres password=mypassword
retention_policy_mode = auto
retention_policy = RECOVERY WINDOW OF 1 days
wal_retention_policy = main
* * * * * /usr/bin/barman cron
*/60 * * * * /usr/bin/barman backup mycluster
mycluster 20160327T080001 - Sun Mar 27 08:01:47 2016 - Size: 6.5 GiB - WAL Size: 5.9 MiB
mycluster 20160327T070001 - Sun Mar 27 07:01:52 2016 - Size: 6.5 GiB - WAL Size: 25.2 MiB
mycluster 20160327T060001 - Sun Mar 27 06:01:50 2016 - Size: 6.5 GiB - WAL Size: 24.4 MiB
mycluster 20160327T050002 - Sun Mar 27 05:01:59 2016 - Size: 6.5 GiB - WAL Size: 22.6 MiB
mycluster 20160327T040001 - Sun Mar 27 04:01:49 2016 - Size: 6.5 GiB - WAL Size: 31.0 MiB
mycluster 20160327T030001 - Sun Mar 27 03:01:53 2016 - Size: 6.5 GiB - WAL Size: 38.7 MiB
mycluster 20160327T020001 - Sun Mar 27 02:01:51 2016 - Size: 6.5 GiB - WAL Size: 68.9 MiB
mycluster 20160327T010002 - Sun Mar 27 01:01:54 2016 - Size: 6.5 GiB - WAL Size: 30.4 MiB
mycluster 20160327T000002 - Sun Mar 27 00:01:54 2016 - Size: 6.5 GiB - WAL Size: 30.2 MiB
mycluster 20160326T230001 - Sat Mar 26 23:01:50 2016 - Size: 6.5 GiB - WAL Size: 24.2 MiB
mycluster 20160326T220002 - Sat Mar 26 22:01:57 2016 - Size: 6.5 GiB - WAL Size: 29.7 MiB
mycluster 20160326T210002 - Sat Mar 26 21:01:53 2016 - Size: 6.5 GiB - WAL Size: 29.8 MiB
mycluster 20160326T200002 - Sat Mar 26 20:01:50 2016 - Size: 6.5 GiB - WAL Size: 36.8 MiB
mycluster 20160326T190002 - Sat Mar 26 19:01:50 2016 - Size: 6.5 GiB - WAL Size: 30.3 MiB
mycluster 20160326T180001 - Sat Mar 26 18:07:48 2016 - Size: 6.4 GiB - WAL Size: 29.8 MiB
mycluster 20160326T170002 - Sat Mar 26 17:01:53 2016 - Size: 6.4 GiB - WAL Size: 30.2 MiB
mycluster 20160326T160002 - Sat Mar 26 16:01:52 2016 - Size: 6.4 GiB - WAL Size: 30.8 MiB
mycluster 20160326T150002 - Sat Mar 26 15:01:51 2016 - Size: 6.4 GiB - WAL Size: 31.1 MiB
mycluster 20160326T140002 - Sat Mar 26 14:01:53 2016 - Size: 6.4 GiB - WAL Size: 37.0 MiB
mycluster 20160326T130002 - Sat Mar 26 13:01:49 2016 - Size: 6.4 GiB - WAL Size: 44.7 MiB
mycluster 20160326T120002 - Sat Mar 26 12:01:48 2016 - Size: 6.4 GiB - WAL Size: 44.2 MiB
mycluster 20160326T110001 - Sat Mar 26 11:01:53 2016 - Size: 6.4 GiB - WAL Size: 50.3 MiB
mycluster 20160326T100001 - Sat Mar 26 10:01:50 2016 - Size: 6.4 GiB - WAL Size: 50.2 MiB
mycluster 20160326T090002 - Sat Mar 26 09:01:56 2016 - Size: 6.4 GiB - WAL Size: 49.6 MiB
mycluster 20160326T080002 - Sat Mar 26 08:01:52 2016 - Size: 6.4 GiB - WAL Size: 50.1 MiB
Filesystem Size Used Avail Use% Mounted on
/dev/dm-0 245G 164G 69G 71% /
barman@backup:~$ barman diagnoseusage: barman [-h] [-v] [-c CONFIG] [-q] [-f {console}] {cron,list-server,show-server,status,check,backup,list-backup,show-backup,list-files,recover,delete,rebuild-xlogdb} ...barman: error: invalid choice: 'diagnose' (choose from 'cron', 'list-server', 'show-server', 'status', 'check', 'backup', 'list-backup', 'show-backup', 'list-files', 'recover', 'delete', 'rebuild-xlogdb')
giulio.calacoci@2ndQuadrant.it | www.2ndQuadrant.it
{ "global": { "config": { "barman_home": "/var/lib/barman", "barman_user": "barman", "basebackup_retry_sleep": "30", "basebackup_retry_times": "3", "compression": "gzip", "errors_list": [], "immediate_checkpoint": "true", "last_backup_maximum_age": "1 DAYS", "log_file": "/var/log/barman/barman.log", "reuse_backup": "link" }, "system_info": { "barman_ver": "1.6.0", "kernel_ver": "Linux backup 3.13.0-83-generic #127-Ubuntu SMP Fri Mar 11 00:25:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux", "python_ver": "Python 2.7.6", "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.4 LTS\nRelease:\t14.04\nCodename:\ttrusty", "rsync_ver": "rsync version 3.1.0 protocol version 31", "ssh_ver": "OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6, OpenSSL 1.0.1f 6 Jan 2014" } }, "servers": {
"medios": { "backups": { "20160328T104346": { "backup_id": "20160328T104346", "backup_label": null, "begin_offset": 36, "begin_time": "Mon Mar 28 13:43:46 2016", "begin_wal": "000000010000000D00000009", "begin_xlog": "D/9000024", "config_file": "/etc/postgresql/9.3/main/postgresql.conf", "deduplicated_size": 6984988471, "end_offset": 5529192, "end_time": "Mon Mar 28 13:46:12 2016", "end_wal": "000000010000000D00000009", "end_xlog": "D/9545E68", "error": null, "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", "included_files": null, "mode": "default", "pgdata": "/var/lib/postgresql/9.3/main", "server_name": "medios", "size": 6984988471, "status": "DONE", "tablespaces": null, "timeline": 1, "version": 90311 },
"20160328T114218": { "backup_id": "20160328T114218", "backup_label": null, "begin_offset": 36, "begin_time": "Mon Mar 28 14:42:19 2016", "begin_wal": "000000010000000D00000012", "begin_xlog": "D/12000024", "config_file": "/etc/postgresql/9.3/main/postgresql.conf", "deduplicated_size": 5732192033, "end_offset": 5767784, "end_time": "Mon Mar 28 14:45:12 2016", "end_wal": "000000010000000D00000012", "end_xlog": "D/12580268", "error": null, "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", "included_files": null, "mode": "default", "pgdata": "/var/lib/postgresql/9.3/main", "server_name": "medios", "size": 6987708218, "status": "DONE", "tablespaces": null, "timeline": 1, "version": 90311 } },
"config": { "active": true, "archiver": true, "backup_directory": "/var/lib/barman/medios", "backup_method": "rsync", "backup_options": "exclusive_backup", "bandwidth_limit": null, "barman_home": "/var/lib/barman", "barman_lock_directory": "/var/lib/barman", "basebackup_retry_sleep": 30, "basebackup_retry_times": 3, "basebackups_directory": "/var/lib/barman/medios/base", "compression": "gzip", "conninfo": "host=myhostip user=postgres password=mypassword", "custom_compression_filter": null, "custom_decompression_filter": null, "description": "Database Server", "disabled": false, "errors_directory": "/var/lib/barman/medios/errors", "immediate_checkpoint": true, "incoming_wals_directory": "/var/lib/barman/medios/incoming", "last_backup_maximum_age": "1 day", "minimum_redundancy": 0, "msg_list": [], "name": "medios", "network_compression": false, "path_prefix": null, "post_archive_retry_script": null, "post_archive_script": null, "post_backup_retry_script": null, "post_backup_script": null, "pre_archive_retry_script": null, "pre_archive_script": null, "pre_backup_retry_script": null, "pre_backup_script": null, "recovery_options": "", "retention_policy": "window 1 d", "retention_policy_mode": "auto", "reuse_backup": "link", "ssh_command": "ssh postgres@myhostip", "streaming_archiver": false, "streaming_conninfo": "host=myhostip user=postgres password=mypassword", "streaming_wals_directory": "/var/lib/barman/medios/streaming", "tablespace_bandwidth_limit": null, "wal_retention_policy": "simple-wal 1 d", "wals_directory": "/var/lib/barman/medios/wals" }, "status": { "archive_command": "rsync -a %p barman@mybackupip:/var/lib/barman/medios/incoming/%f", "archive_mode": "on", "config_file": "/etc/postgresql/9.3/main/postgresql.conf", "current_size": 6983012004.0, "current_xlog": "000000010000000D00000014", "data_directory": "/var/lib/postgresql/9.3/main", "hba_file": "/etc/postgresql/9.3/main/pg_hba.conf", "ident_file": "/etc/postgresql/9.3/main/pg_ident.conf", "last_archived_wal": "000000010000000D00000013", "pgespresso_installed": false, "server_txt_version": "9.3.11", "wal_level": "archive" }, "system_info": { "kernel_ver": "Linux medios 4.4.0-x86_64-linode63 #2 SMP Tue Jan 19 12:43:53 EST 2016 x86_64 x86_64 x86_64 GNU/Linux", "python_ver": "Python 2.7.6", "release": "Distributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.4 LTS\nRelease:\t14.04\nCodename:\ttrusty", "rsync_ver": "rsync version 3.1.0 protocol version 31", "ssh_ver": "OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6, OpenSSL 1.0.1f 6 Jan 2014" } } }}
medios 20160328T114218 - Mon Mar 28 14:45:12 2016 - Size: 6.5 GiB - WAL Size: 0 Bmedios 20160328T104346 - Mon Mar 28 13:46:12 2016 - Size: 6.5 GiB - WAL Size: 52.8 MiB
barman@backup:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dm-0 245G 14G 220G 6% /
barman@backup:~$ barman backup mediosStarting backup for server medios in /var/lib/barman/medios/base/20160329T104511Backup start at xlog location: D/B9000084 (000000010000000D000000B9, 00000084)This is the first backup for server mediosCopying files.Copy done.Asking PostgreSQL server to finalize the backup.Backup size: 6.5 GiB. Actual size on disk: 6.5 GiB (-0.00% deduplication ratio).Backup end at xlog location: D/B9590D24 (000000010000000D000000B9, 00590D24)Backup completedProcessing xlog segments from file archival for medios 000000010000000D000000B9 000000010000000D000000B9.00000084.backup
barman@backup:~$ barman backup mediosStarting backup for server medios in /var/lib/barman/medios/base/20160329T105014Backup start at xlog location: D/BB002570 (000000010000000D000000BB, 00002570)Copying files.Copy done.Asking PostgreSQL server to finalize the backup.Backup size: 6.5 GiB. Actual size on disk: 4.8 GiB (-26.90% deduplication ratio).Backup end at xlog location: D/BB893E54 (000000010000000D000000BB, 00893E54)Backup completed
barman@backup:~$ barman list-backup mediosmedios 20160329T105014 - Tue Mar 29 13:53:01 2016 - Size: 6.5 GiB - WAL Size: 0 Bmedios 20160329T104511 - Tue Mar 29 13:47:46 2016 - Size: 6.5 GiB - WAL Size: 10.5 MiB
The reason I'm doing a backup every 60 minutes is because I would like to have a 1 or 2 days recovery window, and I would like to have the possibility to choose any point in time within that period.
Hi Lisandro,
gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it