Filter when using --xattrs?

Pierre Bernhardt pierre at
Tue Sep 17 09:23:37 UTC 2019

Am 17.09.19 um 02:06 schrieb Luis Fernando via rsync:
> Some xattrs can't be copied between filesystems. For instance, compressed btrfs has a "btrfs.compression" xattr.
> When rsync -X is used in this situation, it exits with error code 23 (partial file/attr), which seems dangerous to be ignored.
> Would it be reasonable to filter filesystem-specific flags when transferring to a different filesystem by default (I'm not sure all fs follows the same namespace, but maybe they start with "filesystem.*"?)? Maybe -XX could be used to force it.
Maybe a optionlist like --no-xattr-<name> for negative copy and
--xattr-<name> for positive copy could be helpfull.
--xattr-<name> could be used to simply copy only some xattr,
--no-xattr-<name> could be used to switch off copy of some xattr if
--xattrs or -X is used.
Maybe it is interested in to add a bunch of filesystem specific
rules instead of each simple xattr. Maybe a list could be used
--xattrs-ext4, --xattrs-btrfs is interested.
The order of the rules could be used to handle the
attributes which should been copied or not.

Here an example:

-X --no-xattrs-btrfs --xattrs-ext4
should do the job to copy all xattrs from btrfs to ext4 which
are only exists on ext4 and btrfs.

That's my 2 cent :-)


More information about the rsync mailing list