Is it possible to create a script to save and restore permissions?

前端 未结 13 1359
逝去的感伤
逝去的感伤 2021-01-30 04:29

I am using a linux system and need to experiment with some permissions on a set of nested files and directories. I wonder if there is not some way to save the permissions for t

13条回答
  •  暖寄归人
    2021-01-30 05:21

    There is also a special tool for that called metastore:

    metastore is a tool to store the metadata of files/directories/links in a file tree to a separate file and to later compare and apply the stored metadata to said file tree. I wrote the tool as a supplement to git which does not store all metadata, making it unsuitable for e.g. storing /etc in a repo. metastore could also be helpful if you want to create a tarball of a file tree and make sure that "everything" (e.g. xattrs, mtime, owner, group) is stored along with the files.

    It's also available as Debian package.

提交回复
热议问题