Saturday, July 1, 2017

How to set file/folder permissions using Rsync from Windows to Linux



I want to transfer lots of files/folders from Windows to Linux using Rsync. On linux server(destination), I want the file permission set to 644, and folder permission set to 755. If possible, I want the ownership set to root.root for all the files/folders. I have tried -p option, but it doesn't work. Thank you for any help.


Answer



You can set the perms using the --chmod parameter e.g.




--chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r 


will force the permissions to be set to 755 for Directories and 644 for Files.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...