I have Samba and Postgres installed on two machines.
I can successfully copy files from one machine to another when fhe files' user and group are my sign-in user and group for both machines. (The same sign in and password on both machines.)
My target directory, /mnt/pg-ralph12/, has been successfully mounted.
mount: //192.168.29.205/pg-ralph12 mounted on /mnt/pg-ralph12
The user and group for my Postgres directory on my source machine is:
getfacl: Removing leading '/' from absolute path names # file: var/lib/postgresql # owner: postgres # group: postgres user::rwx group::r-x other::r-x
For my target directory it's
getfacl: Removing leading '/' from absolute path names # file: mnt/pg-ralph12/not-main # owner: real-owner # group: sudo user::rwx group::r-x group:postgres:rwx mask::rwx other::r-x default:user::rwx default:group::r-x default:group:postgres:rwx default:mask::rwx default:other::r-x
When I attempt to run rsync
sudo rsync -a /var/lib/postgresql /mnt/pg-ralph12/not-main
[sudo] password for real-estate-data-mining: rsync: chown "/mnt/pg-ralph12/not-main/postgresql" failed: Permission denied (13) rsync: chown "/mnt/pg-ralph12/not-main/postgresql/9.6" failed: Permission denied (13) rsync: chown "/mnt/pg-ralph12/not-main/postgresql/9.6/main" failed: Permission denied (13) rsync: chown "/mnt/pg-ralph12/not-main/postgresql/9.6/main/base" failed: Permission denied (13) etc
I've searched high and low on the 'Net trying to find an answer with no success.