Thursday, June 27, 2019

Backing up and restorig ACLS

Backing up the FACLs
Many a times, the backup software may not copy the metadata related to the FACL on the files. In that case you may want to backup the FACL information on the files. Now, the FACL on all the files in a directory (including all sub directories) can be copied in a single file.

# cd /accounts
# getfacl -R * > accounts_facl        ( -R -> recursive )
Restoring the FACLs
When you restore the files in /accounts directory, you would have to restore the FACLs associated with the files in that direcotry. TO do that use the FACL backup file accounts_facl along with the –restore option :

# setfacl --restore=accounts_facl