Inevitably every Linux administrator will eventually have to alter permissions and owerships, perhaps even FACLs. But what happens when your changes go awry? The problem is amplified if you were making changes recursively!
Fortunately there is a pretty simple method to backup the permissions, ownerships, and FACLs:
getfacl -pR /path/to/backup > /root/perms.bak
NOTE: Older versions of getfacl may not have the -p flag; instead use ‐‐absolute-names.
And if you need to restore the permissions:
NOTE: The restore command does not expand ~, so if the backup location is in your home directory be sure to type of the full path!------Share this post: