How to make `getfacl` run with certain order?

你离开我真会死。 提交于 2020-12-15 06:09:27

问题


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.

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.

For example: One permission_backup is as below:

# 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--

Another one is:

# 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--

How to make getfacl run with certain order?


回答1:


Iterate through the directory manually, using a loop or find call and then call getfacl on each file.



来源:https://stackoverflow.com/questions/61193088/how-to-make-getfacl-run-with-certain-order

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!