问题描述
我使用 getfacl -RP ../www>如果要更改权限,请运行
setfacl --restore
,以存储权限,并使用 Beyond Compare
比较两个 permission_backup
.>.
I use getfacl -RP ../www > permission_backup
to store the permission and Beyond Compare
to compare two permission_backup
,if permission has any change,I will run setfacl --restore
.
我发现问题,我运行 getfacl -RP ../www>两次将Permission_backup
移到同一文件夹, permission_backup
中的项目可能具有不同的顺序,然后 Beyond Compare
会告诉我有很大的不同.
I found a problem,I run getfacl -RP ../www > permission_backup
to the same folder twice,items in permission_backup
may have different order,then Beyond Compare
will tell me there's big different.
例如:一个 permission_backup
如下:
# file: ../www/info/2013-09-05/16.html
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
# file: ../www/info/2013-09-05/1.html
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
# file: ../www/info/2013-09-05/23.html
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
另一个是:
# file: ../www/info/2013-09-05/23.html
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
# file: ../www/info/2013-09-05/16.html
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
# file: ../www/info/2013-09-05/1.html
# owner: apache
# group: apache
user::rw-
group::r--
other::r--
如何使 getfacl
以特定顺序运行?
How to make getfacl
run with certain order?
推荐答案
使用循环或 find
调用手动遍历目录,然后在每个文件上调用 getfacl
Iterate through the directory manually, using a loop or find
call and then call getfacl
on each file.
这篇关于如何使"getfacl"以一定顺序运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!