Linux – Backup data while keeping POSIX ACLs and permissions

access-control-listbackupdebianlinuxpermissions

I'm looking for a practical way to backup data from a server and keep all ACLs and permissions. I've looked at tar, but according to Google tar doesn't keep ACLs . I know rsync can keep ACLs and permissions, but only if the target system supports POSIX ACLs and have the same users. In my case I'm doing the backup to a directory that is located on AFS, so POSIX ACLs are not supported.

At the moment I have solved the problem by writing a script that uses find to recurse through the system (I'm using find because I which to exclude some directories) and saves the permissions and ACLs to a text file. This solution works, but is painfully slow. Is there a better solution?

Best Answer

apt-get install star
man star
star -acl -whatever -other -options -you -need

Star is tar with support for extended POSIX headers, that is, the ability to store some extra data about a file in the tar file. The -acl option gets the ACLs; you need it for both archive creation and extraction.

Related Topic