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

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

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.

  • Did you try sudo rsync -aAX ...? I only see sudo rsync -rA ... in your question. – Byte Commander Sep 4 '16 at 15:01
  • Yes, I did try 'sudo rsync -aAX ...' and numerous others such as '-AX', '-a', '-rptgoAX', '-A' all with and without sudo. They all generate results similar to the 'getfacl' output above, with the difference only being the owner & group are 'root' when sudo is used. – user2175064 Sep 4 '16 at 22:33

I will partially answer my own question.

I installed Lubuntu for my children's use on an older PC. I decided to see if Lubuntu's version of rsync would function properly. The version of rsync on Lubuntu 16.04.1LTS is 3.1.1 protocol version 31.

rsync -aAX /source/filename /destination/
rsync -aAX /source/filename /destination/filename
rsync -aAX /source/filename /destination/newfilename

all work fine in Lubuntu.

Either the version of rsync on Ubuntu 14.04LTS (3.0.1 if I recall properly) has a bug, or somewhere along the way I messed up a configuration file or similar.

As I will be installing Ubuntu 16.04.1LTS in place of Ubuntu 14.04LTS, I will not spend any further time attempting to resolve the problem.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.