29

When I use the -a option as is asked and answered in Preserve the permissions with rsync, I got a lot of "rsync: failed to set permissions on" errors.

rsync: failed to set permissions on "/ata/text/RCS/jvlc,v": Operation not permitted (1)
rsync: failed to set permissions on "/ata/text/RCS/jvm,v": Operation not permitted (1)
rsync: failed to set permissions on ...

Why is this? The files are normal files with permission of 0664.

  • Can you give us ls -al output for some of the affected files? – pdo Apr 28 '11 at 17:32
26

Most likely, rsync on the destination end is not running as a user with permission to chmod those files (which would have to be either the file's owner or root).

  • It just happened that the files are owned by _www. Changing the owner solved this issue. Thanks for the help. – prosseek Apr 28 '11 at 20:56
  • 2
    It should be noted that you'll get this error even if rsync's user is in the same group a the files. To fix this error, the files must belong to the same user as rsync, not just the group. – Cerin Dec 21 '15 at 21:16
29

This error happens, because operation for changing the permissions is not permitted. So either check if your user executing the commands have the correct permissions (e.g. he's not the owner), or your file system doesn't support it.

You can ignore the warnings by specifying the additional arguments to rsync to --no-perms and -O (--omit-dir-times) to avoid trying to set permissions and modification times on files/directories. This should solve the errors. Alternatively avoid using -a.

6

As already said, the problem occurs whenever you don't have the permission to change file permissions on the destination of rsync. However, you can avoid this error message by using the two additional arguments --no-o and --no-g.

Example:

rsync -ahv --no-o --no-g target/ destination/
  • 2
    --no-owner and --no-group don't control permissions. You'd want --no-perms for that. If you wanted to avoid trying to change ownerships you'd probably need all three flags. – roaima Jan 16 '18 at 13:22

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.