Let’s say I start with following a/
and b/
directories,
ls -l a/ b/
a/:
total 4
-rw--w-rw- 1 783 783 11 Aug 6 18:57 x
b/:
total 4
-rw-r--rw- 1 1234 1234 3 Aug 6 18:57 x
Using rsync,
rsync -a --no-group --no-owner --no-perms a/ b
Expected result:
ls -l a/ b/
a/:
total 4
-rw--w-rw- 1 783 783 11 Aug 6 18:57 x
b/:
total 4
-rw-r--rw- 1 1234 1234 11 Aug 6 18:57 x
Actual result:
ls -l a/ b/
a/:
total 4
-rw--w-rw- 1 783 783 11 Aug 6 18:57 x
b/:
total 4
-rw-r--rw- 1 iresh iresh 11 Aug 6 18:57 x
While rsync certainly doesn’t sync the permissions and the ownership, it still changes at least the destination file’s ownership.
Is it possible portable solution to achieve the expected result using rsync
or similar tool?