Skip to content

Backup and restore file permissions

When you are, for example, migrating to another server, you may want to preserve the ownership and permissions for those files.

First, install acl. Here’s the command for Debian-based systems:

After that, run the following command to write the permission data for [directory] to permissions.txt

To restore the permissions, run

[sc name=”src” url=”https://www.linux.com/learn/how-easily-back-and-restore-linux-file-permissions” ]

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.