When you are, for example, migrating to another server, you may want to preserve the ownership and permissions for those files. Here’s how you can do it.
acl. Here’s the command for Debian-based systems:
apt-get install acl
After that, run the following command to write the permission data for
getfacl -R [directory] > permissions.txt
To restore the permissions, run: