Sorry, but I can find no solution to this apparent simple problem searching online and this forum.
I have a simple need: copy a directory and its contents to another local location, preserving ACLs and xAttr. This should be quite straight forward per the man page by use of -A and -X options:
rsync -aAX /source/directory /destination/directory
But this fails to preserve them. A simple use of 'cp' works though.
cp -a /source/directory /destination/directory
I have tried various other combinations, even as sudo without success...
sudo rsync -rA /source/directory /destination/directory
I am using Ubuntu 14.04LTS; I am sure that I have ACLs, as I have set the ACLs using 'setfacl' and 'getfacl'
setfacl -R -m "g:gp2:rw" MyDirectoryOfInterest
where getfacl reveals ACLs are in use:
>>getfacl /source/DirectoryOfInterest getfacl: Removing leading '/' from absolute path names # file: source/DirectoryOfInterest # owner: myusername # group: myusername user::rwx user:usr1:rwx user:usr2:rw- user:usr3:r-- group::rwx group:gp1:r-- group:gp2:rw- group:gp3:rwx mask::rwx other::rwx
Note: both source and destination directories are on the same drive, and even in the same directory, with the destination directory simply appending the number '2'. e.g. /home/username/Car and /home/username/Car2.
Note: rsync will run, but will not assign any ACLs and xAttr
>>getfacl /home/myusername/test123/Cars2 getfacl: Removing leading '/' from absolute path names # file: home/myusername/test123/Cars2 # owner: myusername # group: myusername user::rwx group::rwx other::r-x
I need to use rsync, as eventually I wish to utilize this with a NAS that requires use of rsync for my needs. Any help would be appreciated.