When I run the following command owner:group are taken over correctly:


However, when I run the same command to sync from the server to my local PC, the owner:group are not taken over:


I assume this is because on my PC these owner:group do not exist and instead they are replaced with root:root.

How can I still keep the owner:group from the server on my local PC so that in case of a restore the owner:group are set correctly.

Thanks in advance.


You can use '--usermap=' and '--groupmap=' to match local user with remote or '--chown' options. I think it will be something like this:

rsync -chavzP --chown="user:group"--delete SOURCE-SERVER DESTINATION-MY-PC

rsync -chavzP --usermap="localuser:remoteuser" --groupmap="localgroup:remotegroup" --delete SOURCE-SERVER DESTINATION-MY-PC
  • This is unfortunately not what I am looking for, as then the same user:group will still not be set as on the server. Furthermore, on a server there are several user:groups on the file system. – Omexlu Feb 7 at 10:05
  • You can use uid and gid to map. It will be the same user and group, yet the naming translation won't happen. – hunter86_bg Feb 7 at 20:08

Problem solved, I don't used rsync with sudo (root-privileges) so that the parameters aren't get set correctly.

Now it works, adding --numeric-ids in the parameters ensure that always all is set correct on all systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.