recovering backup - rsync acces denied

6 views
Skip to first unread message

dulh...@mailbox.org

unread,
Dec 29, 2021, 8:21:39 AM12/29/21
to pgba...@googlegroups.com


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

unread,
Dec 29, 2021, 9:27:32 AM12/29/21
to pgba...@googlegroups.com
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 pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
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 pgbarman+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pgbarman/2017113754.597726.1640784093443%40office.mailbox.org.
Reply all
Reply to author
Forward
0 new messages