1

I'm doing rsync /local/path/to/src user1@remote:/path/to/dest. dest belongs to user2@remote. How do I keep rsync from chown'ing dest to user1 after syncing?

Please note that I have already tried googling but the switches suggested have not helped and reading the man page has not given me any ideas too. So I'll appreciate your understanding.

2 Answers 2

3

--no-owner may or may not do what you want, depending on whether dest exists or needs to be updated. This is the negated version of --owner, which is described by the man page as:

This option causes rsync to set the owner of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user (see also the --super and --fake-super options). Without this option, the owner of new and/or transferred files are set to the invoking user on the receiving side.

I'm not sure if a directory counts as "transferred" if anything within it changes. As far as I can tell there is no way to tell rsync to not chown updated files at all.

1
  • "As far as I can tell there is no way to tell rsync to not chown updated files at all." I think that may be the issue as I am still not able to achieve what I want. Thanks.
    – johnbendi
    Aug 6, 2015 at 23:52
1

Don't pass the --owner flag to your invocation of rsync. Note that --owner is implied by --all, so if you're using that option, you'll need to specify --no-owner to turn off that behaviour.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .