Wednesday, August 17, 2011

ZFS chmod -R and what not to do

Suppose you need to recursively apply a ZFS ACE to a directory structure. This is what you should not start by doing:

find . -type d -exec chmod -R A+group:videocat:r-x---a-R-c--s:-d----:allow {} \;

The problem is the -R. Guess what that does. :)

Chant fix!


for each in `find . -type d`; do while ls -dV $each | grep videocat > /dev/null; do chmod A0- $each; done; done;

No comments:

Post a Comment