How to backup and restore permissions

  • 7015177
  • 11-Jun-2014
  • 11-Jun-2014

Environment

SUSE Linux Enterprise Server

Situation

Need to back up permissions
Permissions are incorrect because the cp command was ran without the argument -p for keep permissions

Resolution

For the example below, /usr will be used as the directory to backup and restore
  1. Launch a terminal session and change to the parent of the directory that needs to be backed up
  2. Type getfacl -R /usr > p.acl to create a permissions file called p.acl
  3. Copy the p.acl to the server where you want to restore permissions on
  4. Launch a terminal session and change to the directory of the p.acl file
  5. type setfacl --restore=p.acl to restore the permissions