From owner-freebsd-questions@freebsd.org Tue Apr 26 14:31:40 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B414B1C202 for ; Tue, 26 Apr 2016 14:31:40 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 590511A5A for ; Tue, 26 Apr 2016 14:31:40 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: by mailman.ysv.freebsd.org (Postfix) id 58678B1C201; Tue, 26 Apr 2016 14:31:40 +0000 (UTC) Delivered-To: questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5814DB1C200 for ; Tue, 26 Apr 2016 14:31:40 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "fileserver.home.qeng-ho.org", Issuer "fileserver.home.qeng-ho.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9563F1A58 for ; Tue, 26 Apr 2016 14:31:39 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.15.2/8.15.2) with ESMTP id u3QENOPu037159; Tue, 26 Apr 2016 15:23:25 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Subject: Re: deleting /tmp files from crontab To: David Banning , Michael Schuster References: <20160426123012.GA57555@skytracker.ca> <571F63B3.4040803@gmail.com> <20160426141301.GA62352@skytracker.ca> Cc: questions@freebsd.org From: Arthur Chance Message-ID: Date: Tue, 26 Apr 2016 15:23:24 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160426141301.GA62352@skytracker.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:31:40 -0000 On 26/04/2016 15:13, David Banning wrote: > On Tue, Apr 26, 2016 at 02:48:51PM +0200, Michael Schuster wrote: >> On 26/04/16 14:30, David Banning wrote: >>> I am attempting to delete my .spamassassin files from my /tmp directory >>> >>> putting a command in my crontab; >>> >>> find /tmp/.spam* -mmin +360 -delete >> >> the find syntax looks strange (assuming this is straight 'find', not >> somthing crontab-specific); normally, I'd expect to see >> >> # find /tmp -name '.spam*' -mmin +360 -delete > > That seems to delete the files, but not the directories starting in .spam* > > Reviewing the find man page, it appears the -delete implementation will > not work unless the directory is empty. Still looking for solutions here. Take a look at the -d or argument-less -depth primaries. From the man page -depth Always true; same as the non-portable -d option. Cause find to perform a depth-first traversal, i.e., directories are visited in post-order and all entries in a directory will be acted on before the directory itself. -- Moore's Law of Mad Science: Every eighteen months, the minimum IQ necessary to destroy the world drops by one point.