recovering backup - rsync acces denied

Skip to first unread message

Dec 29, 2021, 8:21:39 AM12/29/21

I am trying to get streaming backups going.

As I couldn't figure out yet how to address a secondary recovery server (which I assume to be the recomemnded method) I try to recover a barman backup on the main server where I run into rsync errors. 

barman@vm-51150-0188:~> barman recover vm-51150-0196 20211228T144114 /opt/db/data/postgres/data
Starting local restore for server vm-51150-0196 using backup 20211228T144114
Destination directory: /opt/db/data/postgres/data
Copying the base backup.
ERROR: Failure copying base backup: data transfer failure
rsync error:
rsync: change_dir#1 "/opt/db/data/postgres/data" failed: Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(621) [Receiver=3.1.3]

my surpise that rsync is involved at all with backup-method postgres aside ... I can't make much sense of this
  1. there is a user barman on that server.
  2. the permissions on the PGDATA directory are quite permissive (0760 with barman user being a member of the postgres group)
  3. I can rsync random files as barman user from the barman server into the PGDATA folder

Michael Wallace

Dec 29, 2021, 9:27:32 AM12/29/21
Rsync is used for recovering backups regardless of the backup method used to create them. In your example the permissions on your PGDATA directory aren't going to be enough since the barman user will need execute permissions on the target directory.

In order to recover to a remote server you will need to add the --remote-ssh-command option to your `barman recover` command, e.g.: barman recover --remote-ssh-command='postgres@SECONDARY_SERVER' vm-51150-0196 20211228T144114 /opt/db/data/postgres/data

You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web, visit
Reply all
Reply to author
0 new messages