Operating System - HP-UX
1825775 Members
2114 Online
109687 Solutions
New Discussion

Re: Ecluding nfs-client mounts from the find command

 
john guardian
Super Advisor

Ecluding nfs-client mounts from the find command

Hi. I have about 3dz systems in a software development env that mount several directories under /usr/local/lib (clibs, plibs, glibs and head). They've recently been moved from an NPAR on a SuperDome to a SAN. While access seems slower, that's not a problem as it's a development env and no-one's complaining. Except me. I use the find command in various scripts for searching for excessively large, old, and world writeable files. I really don't need to look at these NFS dirs as they are "controlled" by a configuration lib group. Nothing is placed on these dirs unless they do it, they know the rules, follow them AND we use the commercial version of TRIPWIRE.

I simply want to exclude nfs from the find search. Would I use the xdev or mount options and what would the syntax of the command look like? Sorry if the above seemed so long-winded.

Thanks.
7 REPLIES 7
john guardian
Super Advisor

Re: Ecluding nfs-client mounts from the find command

Oops! The subject should read "eXcluding". I missed the "X".
Robert-Jan Goossens
Honored Contributor

Re: Ecluding nfs-client mounts from the find command

Hi John,

add the "-fstype vxfs" to your find query.

Robert-Jan
Pete Randall
Outstanding Contributor

Re: Ecluding nfs-client mounts from the find command

You can use fstype:

find /startdir ! -fstype nfs

I believe you can also use -xdev as well - it's up to you.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Ecluding nfs-client mounts from the find command

Actually, I just tried both my and Robert-Jan's solution on my 11.11 system and neither worked. The xdev option did, however.


Pete

Pete
Robert-Jan Goossens
Honored Contributor

Re: Ecluding nfs-client mounts from the find command

try the fsonly option.

# find . -fsonly vxfs

Thanks Pete!
john guardian
Super Advisor

Re: Ecluding nfs-client mounts from the find command

Message for Pete:

What exactly did you use for syntax for the find cmd when using xdev?

I've tried the "! -fstype nfs" syntax before, which like it already been said never works.
Pete Randall
Outstanding Contributor

Re: Ecluding nfs-client mounts from the find command

John,
# ll -d /nfs/yukon/apps/hols
dr-xr-xr-x 83 root sys 2048 Sep 6 09:12 /nfs/yukon/apps/hols
# find / -xdev -name hols
#


Pete

Pete