Shell or Perl script for removing number ACL from files
$30-250 USD
Terminado
Publicado hace más de 11 años
$30-250 USD
Pagado a la entrega
We are using XFS ACLs extensively within our company. That means we have thousands of thousands of files and directories with XFS ACLs.
For certain users and groups, we no longer maintain their names. That means we have only numeric ACL on our file or directory. We need a script to get rid of those.
Example, let's have a file (getfacl output):
# owner: root
# group: root
user::rwx
user:www-data:--x
user:test:r-x
user:test_devel:--x
user:test_devel2:--x
user:test_kvlsr:--x
user:test_bkblog:--x
user:5138:--x
user:test_config:--x
user:test_bizufb:--x
user:5203:--x
user:test_route:--x
group::---
mask::r-x
other::---
default:user::rwx
default:user:www-data:--x
default:user:test:r-x
default:user:test_losutaz:--x
default:user:5793:--x
default:user:test_route:--x
default:group::---
default:mask::r-x
default:other::---
We would like to get rid of 5793, 5138, 5203. Obviously we would like to keep: test_route, test_losutaz, test, www-data, and so on
Script should do this for users and groups as well. Scripts should do this for regular ACLs and default ACLs too.
Script should take one parameter - file or directory.
Script should have a -R switch for going recursively from that directory and removing numeric ACLs from the files.
Sounds like a job for which Perl *is* the best possible tool :) Although not really essential, it would be of help to know the exact OS and Perl version[s] you have to consider. Anyway, I'd be glad to help. Thank you.