Skip site navigation (1)Skip section navigation (2)
Date:      22 Nov 2000 06:34:40 +0100
From:      Cyrille Lefevre <clefevre@cybercable.fr>
To:        "Daniel O'Connor" <doconnor@gsoft.com.au>
Cc:        Brian Reichert <reichert@numachi.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: find, -delete, and relative paths
Message-ID:  <hf50a7tb.fsf@gits.dyndns.org>
In-Reply-To: "Daniel O'Connor"'s message of "Tue, 21 Nov 2000 12:08:56 %2B1030 (CST)"
References:  <XFMail.001121120856.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
"Daniel O'Connor" <doconnor@gsoft.com.au> writes:

> On 20-Nov-00 Brian Reichert wrote:
> >  I didn't find anything after an admittedly quick look intp PRs and the mail
> >  list archives:
> >  
> >  Under FreeBSD 3.4-RELEASE, we are running a simple log file scrubber:
> >  
> >    15 3 * * * find /usr/local/logs/lsp \! -ctime 1 -delete
> >  
> >  I pointedly am using an absolute path, yes I get this warning repeatedly:
> >  
> >    find: -delete: /usr/local/logs/lsp: relative path potentially not safe
> >  
> >  How can I suppress this warning?  Is it a bug in find, or did I
> >  misunderstand the manpage?
> 
> I don't know why, but I think find prints those messages when you attempt to delete
> a directory.
> 
> If you do ->
> 15 3 * * * find /usr/local/logs/lsp -type f -a \! -ctime 1 -delete
> 
> it should work..

15 3 * * * find /usr/local/logs/lsp -depth \! -ctime 1 -delete

could be better, deletes file entries before directory ones.

PS : -a is not necessary, it's always implied except if -o of course.

Cyrille.
--
home: mailto:clefevre@citeweb.net work: mailto:Cyrille.Lefevre@edf.fr


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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