Rsync over SSH and file ownership

Hello all,

I am using a Western Digital Mycloud NAS and a macbook running OSX 10.8.

I am using rsync to backup files and folders. 

The problem is that when the folders get ported over via rsync, the owner and root are changed and I can no longer delete or change the files. I don’t want to have to manually go in and change the permissions. 

So, here is what the permissions look like if I manually drag and drop a file into the NAS:

Code:

-rw-rwxr--+ 1 amrogers3 share 4096 Jan 6 16:14 Testfile1

I can delete the files no problem.

And here is what is assigned when I use rsync:

Code:

drwxr-xr-x+ 2 daapd staff 4096 Jan 4 10:18 Testfile1

I can’t change, delete, or edit files.

How can I use rsync to apply the proper permissions. I have googled and tried a few things, but nothing seems to be working.

amrogers3,

Please be aware that SSH may void your unit’s warranty.

The short answer is, you can’t. Rsync across file systems with the expectation of maintaining ownership only works if you have global UID and GID mapping.

That’s weird, I got it to work running rsync over SSH, logging in as a local user on the NAS.

That’s a whole different thing.

RSYNC logging in via SSH means the user you logged in as will own all the files.   That’s not preserving “ownership.”