I see a few requests that are similar to mine using the prune action, but what I want to do is recursively navigate through a docroot:
/opt/web
which contains several files and directories:
/opt/web/foo.html (file)
/opt/web/bar.txt (file)
/opt/web/DONOTCHGRP (dir)
/opt/web/assets (dir)
I want to go through the whole docroot and if any files are not group owned by "mygroup" then change the group to "mygroup" and set the group write permission bit, except completely ignore the DONOTCHGRP directory itself and its contents.
I currently have the command to do the chgrp/chmod with no filtering on anything:
find /opt/web -not -group mygroup |
xargs -I {} sh -c '{ chmod g+w {}; chgrp mygroup {};}'
I just can't figure out how to completely skip the DONOTCHGRP directory. Any help will be appreciated.