implied-dirs tail component being chown'd
Chris Roehrig
croehrig at house.org
Thu Aug 29 20:49:04 UTC 2019
Thanks Francis,
Neither of those really do what I'd like: to properly sync/preserve ownership/attributes for files below the root of the transfer (which are not necessarily me:me -- I use groups for sharing between users), but to leave the root attributes untouched, and to use filters anchored at the root.
Upon re-reading the man page, I see I misunderstood how /./ and --no-implied-dirs works. I thought I could use them to solve this problem, but it doesn't look like it.
From my perspective it seems like a mis-match between where filters are anchored ("exclude the root") and where attributes are touched ("include the root").
This is a situation I encounter a fair bit. On Windows and Mac there are a lot of user directories that are system-owned or have special system ACLs, xattrs, etc: $HOME, Downloads, Desktop, Library, etc,
and I would like rsync to avoid touching those ownership/attributes, but also to use filters that are anchored at the root of those (so that they can be applied globally to any user).
E.g.
backup:
rsync -a ". HomeDir.rfilter" /Users/<someuser>/./ server:BACKUPDIR/Users/<someuser>/
restore:
rsync -a ". HomeDir.rfilter" server:BACKUPDIR/Users/<someuser>/./ /Users/<someuser>/
where HomeDir.rfilter is anchored at a user's home directory (and therefore applies to any user) and attributes to the left of the /./ remain untouched (which was my misunderstanding -- it doesn't work that way).
I hope this illustrates the issue I'm trying to solve. I had thought this might be a somewhat common problem, but it doesn't seem like there is a good solution to this. The easiest workaround for me so far is just to overwrite the Mac/Windows system-owned attributes and make them owned by <someuser>:<someuser>, but it's not ideal.
-- Chris
On Tue Aug 27 2019, at 11:31 PM, Francis.Montagnac at inria.fr wrote:
>
> Hi.
>
> On Tue, 27 Aug 2019 14:56:25 -0700 Chris Roehrig via rsync wrote:
>
>> rsync -a --super --relative --no-implied-dirs "--filter=. HomeWin.rfilter" /cygdrive/c/Users/me/./ myserver:/WinBACKUP/Users/me/
>
> If you are connecting to myserver as you (not root), simply
> suppressing the --super option should work.
>
> Otherwise (with a recent version of rsync) add: --chown me:me
>
> --
> francis
More information about the rsync
mailing list