*BSD News Article 27847


Return to BSD News archive

Xref: sserve comp.sys.sun.admin:26516 comp.os.386bsd.bugs:2127
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!howland.reston.ans.net!pipex!uunet!gatekeeper.us.oracle.com!oracle!unrepliable!bounce
Newsgroups: comp.sys.sun.admin,comp.os.386bsd.bugs
From: bcaruthe@us.oracle.com (Bruce Caruthers)
Subject: Re: find goes to NFS disks?
Message-ID: <1994Feb24.082238.28108@oracle.us.oracle.com>
Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
Nntp-Posting-Host: kate.us.oracle.com
Organization: Oracle Corporation, Redwood Shores, CA, US
References: <HSU.94Feb13044616@laphroaig.cs.hut.fi> <103946@cup.portal.com>
Date: Thu, 24 Feb 1994 08:22:38 GMT
X-Disclaimer: This message was written by an unauthenticated user
              at Oracle Corporation.  The opinions expressed are those
              of the user and not necessarily those of Oracle.
Lines: 34

In article <HSU.94Feb13044616@laphroaig.cs.hut.fi>
>hsu@cs.hut.fi (Heikki Suonsivu) writes:
>
> The following command is not supposed to go to NFS mounted disks (It is
> from default root crontab). 
> 
> find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
> 

In article <103946@cup.portal.com> thad@cup.portal.com (Thad P Floryan) writes:
>The line:
>
>	find . \( -fstype nfs -prune \) -o \( -newer $REF_DATE -print \) | \
>		sort -r > $TAPEDIR/incr$YYMMDDHHMM
>
>is from one of my daily incremental scripts, and it works properly.

I imagine the reason the second one works and the first one doesn't is
that find probably works like a C conditional: from left to right.
So, in the first one, it never gets around to noticing whether the
fstype is mounted, until after the .nfs check, if it ever gets to it.
The second version checks the locality first, and thereby actually
skips NFS mounted volumes.

Cheers,
   -bkc
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Imagination is the one weapon in the war against reality." (Jules de Gaultier)
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bruce Caruthers                  "Reality doesn't always live up to ideals ...
bcaruthe@Oracle.Com       but that doesn't mean that they're not worth having."
bkc@cs.Princeton.Edu                -- blurb for "Romantic Ideals", Analog 2/94