Link to home
Start Free TrialLog in
Avatar of lolaferrari
lolaferrariFlag for United Kingdom of Great Britain and Northern Ireland

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 {} \;


Avatar of arnold
arnold
Flag of United States of America image

Does the environment use centralized credential management, open ldap, etc.
.
Avatar of lolaferrari

ASKER

It uses local accounts believe it or not
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Arnold I've set the uids and gigs to be the same. On the source host where the filers are and on the target host. I have about 6 Filers where this has to happen.