Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2006 21:34:57 +0300
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: find(1) -d vs -prune; /etc/periodic/daily/100.clean-disks
Message-ID:  <20060308183456.GK4474@comp.chem.msu.su>
In-Reply-To: <20060308144351.GA26748@stack.nl>
References:  <20060306174058.GA32164@stack.nl> <20060307232151.GA91873@comp.chem.msu.su> <20060308144351.GA26748@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 08, 2006 at 03:43:51PM +0100, Jilles Tjoelker wrote:
> On Wed, Mar 08, 2006 at 02:21:51AM +0300, Yar Tikhiy wrote:
> > On Mon, Mar 06, 2006 at 06:40:58PM +0100, Jilles Tjoelker wrote:
> > > Possible solutions/workarounds:
> > > 1. do still call -prune and some primaries without side effects
> > >    in pre-order even if -d is in effect, even though this does not
> > >    fit at all in find(1)'s design.
> > > 2. document the bug and run a find -x over all local r/w filesystems
> > >    in 100.clean-disks (-x and -d work together properly).
> > > 
> > > What would be the best way to go on?
> 
> > The property of -prune with respect to -d is already documented on the
> > find(1) manpage.
> 
> Oh, didn't read that bit. Too busy reading the source code :P
> 
> > As for 100.clean-disks, I fail to see why -prune is needed there.
> > One can mount a file system read-write at a directory of a read-only
> > file system.  Some bullet-proof installations have their / mounted
> > read-only.  Perhaps the invocation of find(1) in 100.clean-disks
> > should be as follows:
> 
> > 	find / -fstype local ! -fstype rdonly \( $args \) ...
> 
> > Does it make sense?
> 
> No, as that still searches through all the NFS filesystems, so I get the
> daily output mail at 4 PM or such. (The effect is the same as the
> original command.)
>
> My idea of doing a find -x over each applicable filesystem seems even
> better in the light of this. It is just a little hard to get the list of
> local read-write filesystems in a shell script (df -l to get the locals,
> mount -p to get the read-writes, intersect these). Will look at it
> later.

In the good old days when NFS was the only remote file system, the
following trick would do:

	localrw=$(mount -p -t nonfs | awk '$4 == "rw" {print $2}')
	find -x $localrw \( $args \) ...

But today some hackery around ${netfs_types} should be added, as in
/etc/rc.d/mountcritlocal.

-- 
Yar



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060308183456.GK4474>