asked on
Find  - perms checking and prune on Redhat
I was looking for some experts to help me with some find commands to check perms with pruning and find commands to check perms of files and dirs that only allow the owner to read them since i need people that are also in it's group to be able to read the data too. This is on RHEL6 and RHEL 7
(1) I have to mount an existing FILER full of data on another system and be sure that on the target system where it's mounted that the existing user account there will be able to read the data and also write to the filesystem. I want to identify all files and dirs with perms 400 600 or 700 and change those perms to 750. I've also added the user and group that owns the data on the Filer onto the target system to help the target user be able to read it and for the user on target that will be writing to the FILER i've modified the target user to include the source group but this may not be enough since the perms on the data might not have group perms. I also need to prune out the multiple sub-dirs in the check called .snapshot since it shows the .snapshot as a mount and when i run df -h there's
100's of them and i end up having to unmount it's root NFS Filer to get rid of them. These .snapshot are read-only fs but cause me pain if i can't exclude them.
I tried commands below but never got there.
This command prunes out all dirs that have .snapshot but this command prints file that have perms with 664 too. Also tried flag -perm 700 without any luck.
find ./path/ -path '.snapshot' -perm g-r -prune -o -name -type d -exec ls -l {} \;
(2) Once I run the pre-check to identify the files and have a list. I'm then going to run another similar command that also changes the perms of those files.
This command won't prune out .snapshot but it does change the perms.
find ./path/ -path '.snapshot' -prune -o -name -type d -exec chmod 755 {} \;
ASKER
ASKER
.