0

I have a directory on my server to which multiple users copy their data using rsync. All users use the options -a -h -v. All users are in the same group used for this directory. All users mount the share via NFS and use rsync in "local mode". While syncing the output of rsync shows several errors:

rsync: failed to set permissions on <path>: Operation not permitted (1)

which happens on those files the user which executes rsync is not the owner. This behaviour is correct, since only the owner should change permissons. I want to prevent the error from being posted to the log since it is very hard to detect "real" errors in the sync. How can I prevent rsync from setting permissions on files the executing user is no the owner?

This question is similar to this: Setting permissions with rsync only if the file is owned by the user althoug i do not use --chmod option and this problem only applies to existing files.

Edit 1: The fact that this relies on the owner is my interpretation. All files which show this error are owned by someone else. Additionally, this user does not exist on my machine. So, when I inspect the directory via ls -al, I only see the UID, not the username. May this be an issue? The UIDs are identical on the server an all clients.

Edit 2: Added info about local mode of rsync

  • I don't see this error. For example as a non-root user this runs quietly: rsync -avh /etc/h* /tmp/zzz – roaima Dec 30 '19 at 20:24
  • added information above. – Donut Dec 30 '19 at 21:05
  • You can try to work around the lack of username information by changing -a to -rlt. And/or by including --numeric-ids – roaima Dec 30 '19 at 22:01
0

Thank you guys for Commenting. During experiments with the suggested parameters, I discovered the cause of this error message. My question didn't include the information which was crucial for this, so it was impossible to guess the cause.

I rechecked all directories and discovered that the files were out of sync. The files which show the error were owned by me on my local copy and by another person on the server. So, my rsync process read the ownership of the local copy and wanted to copy the user permissions which was denied by the (NFS) server.

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.