Backing up file level permissions in Linux

In the past, I think we all have went to change ownership/permissions of a bunch of directories/files only to realize we made a mistake and accidently change the wrong files. So I have started backing up permissions using a tool called “getfacl”. You just do a “getfacl -R /home/httpd/corp > /tmp/backup.acl” and that writes all of the files, their ownership and permissions and any flags (ie: sticky bit, etc) to the file backup.acl. THEN, if you want to restore it, it’s a simple command.

On Debian, just do an “apt-get install acl” and it will give you both the getfacl (to get/backup the permissions) and setfacl (to restore the permissions). Here is an example of the commands:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s