Thanks!
--
Randall P. Johnson
Randy....@mci.com
work (916) 649-6174
fax (916) 649-6062
I think the nearest you can do is specify -mount and list
all the local filesystems.
-local merely stops matches in remote filesystems from
being further processed, but they are still traced as
it might be that a local filesystem is mounted somewhere
inside a remote one and/or some earlier command line
switches might still be applicable to remote files.
Try some refinement based on...
find `awk '$3=="ufs" {print $2}' /etc/mnttab` -mount .....
--
Andrew Gabriel
Consultant Software Engineer
>Hi,
>I'd like to stop the find command from traversing NFS mounted filesystems
>on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
>the trick. Does anyone know how?
I don't have any NFS file systems, so I can't test this, but O'Reilly's
"Unix Power Tools" suggests the "-o -fstype nfs -prune" clause. The "-o"
may be unnecessary, the example isn't very clear.
-Shel
--
Sheldon T. Hall
sh...@cis.compuserve.com
This message sold by weight, not by volume;
Content may settle during shipment.
> Hi,
> I'd like to stop the find command from traversing NFS mounted filesystems
> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
> the trick. Does anyone know how?
Can't you just do a "find -fstype ufs ...." ?
-- katherine
Katherine Hosch, System Administrator k...@cs.uno.edu
Department of Computer Science 504-280-7190
University of New Orleans 504-280-7228 (fax)
New Orleans, LA 70148 504-723-6953 (pcs)
-- "I read, much of the night, and go south in winter."
find / -name junk.out ! -fstype nfs -print
the ! means don't go there.
Jamie
Katherine Hosch wrote in message <3649C0CA...@cs.uno.edu>...
Actually, you should use
find <path> -fstype ufs <other expressions>
if you want "to stop the find command from traversing NFS mounted
filesystems" rather than -fstype nfs You need -prune if you don't want to
search directories below the first pattern matched.
--
Mikhail Gloukhovtsev m...@udel.edu
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Isn't -local also an appropriate (and much shorter)solution?
Let's see what "man find" says
-local True if the file system type is not a remote
file system type as defined in the
/etc/dfs/fstypes file. nfs is used as the
default remote filesystem type if the
/etc/dfs/fstypes file is not present.
Many times a simple way is provided :-)
Cheers everyone.
> Katherine Hosch wrote in message <3649C0CA...@cs.uno.edu>...
> >"Randall P. Johnson" wrote:
> >
> >> Hi,
> >> I'd like to stop the find command from traversing NFS mounted filesystems
> >> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to
> do
> >> the trick. Does anyone know how?
> >
> >Can't you just do a "find -fstype ufs ...." ?
> >
> >-- katherine
> >
> >Katherine Hosch, System Administrator k...@cs.uno.edu
> >Department of Computer Science 504-280-7190
> >University of New Orleans 504-280-7228 (fax)
> >New Orleans, LA 70148 504-723-6953 (pcs)
> >
> >-- "I read, much of the night, and go south in winter."
> >
> >
--
************************************************************
* A goofy Unix SA working for a large computer equipment *
* manufacturer and services provider. Opinions expressed *
* are mine and not my employers. jkotches@_pobox_.com *
************************************************************
Katherine Hosch <k...@cs.uno.edu> writes:
>"Randall P. Johnson" wrote:
>> Hi,
>> I'd like to stop the find command from traversing NFS mounted filesystems
>> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
>> the trick. Does anyone know how?
>Can't you just do a "find -fstype ufs ...." ?
No. That command will examine only files on ufs filesystems, but it
will a lso traverse nfs mounts looking for them. (It's just like -type f;
it looks at all files)
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
"James Dennis" <jde...@netset.com> writes:
>When I have wanted to do this in the past, I've used something like
>find / -name junk.out ! -fstype nfs -print
>the ! means don't go there.
No, it means "ignore the file if it's not an nfs file".
It will still look at all nfs files.
You need to use -xdev, -local or -fstype nfs -prune -o ...
I believe -local only solves half the problem: it may prune nfs
filesystems, but find stiff traverses loopback mounts, so you could
potentially get multiple matches reported for the same file.
Something like
find / ! -fstype ufs -prune
should, I believe, prune all non-ufs paths, including lofs mounts.
Casper, is this correct?
--
Dean Neumann (dneu...@neumann-associates.com)
Neumann & Associates Information Systems Inc.
Note: Remember to delete the ".delete-this-part"
portion of the return address before replying.
find /mnt -fstype lofs -print (only finds directories)
find /mnt -fstype ufs -print (finds everything other than directories)
System info:
SunOS mindwarp 5.6 Generic_105181-09 sun4m sparc SUNW,SPARCstation-10
This is definitely not what I would have expected! However, the "BUGS"
section of lofs(7fs) somewhat explains what's happening:
>BUGS
> (1) Files can be modified on a read-only loopback mounted
> file system and (2) a loopback mounted file system can be
> unmounted even if there is an open regular file on that file
> system. The loopback file system works by shadowing direc-
> tories of the underlying file system. Because no other file
> types are shadowed, the loopback file system can not enforce
> read-only access to non-directory files located on a read-
> only mounted loopback file system. Thus, write access to
> regular files located on a loopback mounted file system is
> determined by the underlying file system. In addition, the
> loopback file system can not correctly determine whether a
> loopback mounted file system can be unmounted or not. It
> can only detect when a directory is active or not, not when
> a file within a directory is active. Thus, a loopback
> mounted file system may be unmounted if there are no active
> directories on the file system, even if there are open files
> on the file system.
In article <364E0325...@neumann-associates.com>,
--
ftp> get |fortune
377 I/O error: smart remark generator failed
Bogonics: the primary language inside the Beltway
mailto:rlh...@mindwarp.smart.net http://www.smart.net/~rlhamil
It will (I suspect) fail to find a ufs filesystem mounted in
an NFS filesystem, which whilst rare, is certainly not unheard
of. Hence my earlier suggestion...
rlh...@smart.net (Richard L. Hamilton) writes:
>find /mnt -fstype lofs -print (only finds directories)
>find /mnt -fstype ufs -print (finds everything other than directories)
>System info:
>SunOS mindwarp 5.6 Generic_105181-09 sun4m sparc SUNW,SPARCstation-10
>This is definitely not what I would have expected! However, the "BUGS"
>section of lofs(7fs) somewhat explains what's happening:
Yes, only lofs directories have lofs nodes.