Jump to content

Rsync Permission - Inherit Form Destination Parent Folder?


Recommended Posts

Posted (edited)

Hello,

 

I am trying to copy data from an Ubuntu machine onto a Synology NAS. I have setup Rsync to do this. However, the permissions on the files when they are copied destination (Synology NAS) aren't correct. Folders that have been created are ok. I would like the permissions to be inherited from the parent folder on the NAS. However, whatever I seem to do they are in some way not correct.

 

I am using this command.

 

sudo rsync -rtvm --perms -p --prune-empty-dirs --remove-source-files "/Test/" [email protected]:'"/volume1/dir/Test/"'

 

I have also used

 

sudo rsync -rtvm --no-perms --prune-empty-dirs --remove-source-files "/Test/" [email protected]:'"/volume1/dir/Test/"'

 

sudo rsync -rtvm --chmod=ugo=rwX --prune-empty-dirs --remove-source-files "/Test/" [email protected]:'"/volume1/dir/Test/"'

 

sudo rsync -rtAvm --chmod=ugo=rwX --prune-empty-dirs --remove-source-files "/Test/" [email protected]:'"/volume1/dir/Test/"'

 

Can someone help me crack this please?

 

Thanks

Edited by FN-GM
Posted (edited)

-p should do it.

Are you having trouble with POSIX permissions or ACL's. If the latter, does the filesystem have acl support enabled? Where do the permissions come from? Ie are the user accounts mapped correctly in the target system?

Edited by dmj
Posted

-p doesn't work either.

 

I am not sure what type of permissions Synology uses. When you say mapped correctly, how do you mean please?

Posted

I don't know/understand what synology is, so I suspect it's some sort of *nix. Given that assumption can you say whether you using a centralised system for managing your users? - you won't be able to match users on different systems unless the user uid's match.

 

it would be helpful if you post the results of

 ls -l 

and (if there is a '+' at then d of the line, indicatiing an ACL run:

getfacl

on bothfilesystems.

Posted
I don't know/understand what synology is, so I suspect it's some sort of *nix. Given that assumption can you say whether you using a centralised system for managing your users? - you won't be able to match users on different systems unless the user uid's match.

 

it would be helpful if you post the results of

 ls -l 

and (if there is a '+' at then d of the line, indicatiing an ACL run:

getfacl

on bothfilesystems.

 

Synology is my 4 bay NAS.

 

We aren’t using a centralised system from users. This is actually a home setup. I will run those commands when I get back home.

 

To be honest, I didn’t expect this to me such a complex issue. I assumed it would inherit the permissions on the destination folder like it would in Windows. I am not a huge Linux expert so thanks for your patience.

Posted

No worries. Windows wouldn't copy the permissions unless the same user existed on both systems and I suspect this is the issue here - or rather the user ID's on both systems don't match. if the users match with 'ls -l' (in the directory), run 'id ' and make sure the UID matches on both systems.

 

Unix systems have the root user as UID=0 and the first user usually has an UID=1001, or 501 on macs. The UID's on both systems will need to match.

Posted
No worries. Windows wouldn't copy the permissions unless the same user existed on both systems and I suspect this is the issue here

 

That's my intended outcome. I don't want it to touch the permissions at all. I don't want them to match the source.

 

 

Sorry I didn't get chance to run the commands. There was power outage at work that I had to attend to. Just got home and off to bed. I will report back shortly. Shall I send the results via PM as they may contain names?

 

Thanks

Posted

Hello,

 

Sory about the delay. I ran the commands on both systems. I get output from my Ubuntu box but the Synology not so much so....

 

user@NAS:~$ ls -l

total 0

user@NAS:~$ getfacl

-sh: getfacl: command not found

 

I can PM the Ubuntu output if you like?

 

Thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...