From owner-freebsd-questions@freebsd.org Tue Apr 26 14:30:03 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 E6F93B1C05E for ; Tue, 26 Apr 2016 14:30:03 +0000 (UTC) (envelope-from fstd.lkml@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id C62081891 for ; Tue, 26 Apr 2016 14:30:03 +0000 (UTC) (envelope-from fstd.lkml@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id C1667B1C05D; Tue, 26 Apr 2016 14:30:03 +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 C10E4B1C05C for ; Tue, 26 Apr 2016 14:30:03 +0000 (UTC) (envelope-from fstd.lkml@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93A901890 for ; Tue, 26 Apr 2016 14:30:03 +0000 (UTC) (envelope-from fstd.lkml@gmail.com) Received: by mail-io0-x243.google.com with SMTP id k129so2330191iof.3 for ; Tue, 26 Apr 2016 07:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hmaj3eR9gYFpeffsggau1qZxLLMy4vt6uo4tJjg8Abw=; b=0N2nMnlYA3eHzF+e6q2PErRHezBu8JqXnFZ5dA3iZBb26X2NFYLu9H+evubxGHMsYm cUSfRtOJ7eNVeKIul53cZNlFb+ayKh+ZH7UjHu21UxGEjjw5BPKuEjdGTGHTMBdfLcKs 7s7qDwy4MDoUM15M5/Feaja8aC6O2T8qF8FAGC931GofxRHn15hGE+hHNmNjdK2DN/zy PLp6XIeAO0TpeKFAg/vKNBGKzbtBFFJ+b32Nnh0+pXYqMEdl4ow1AgohkKqcykvTkT9t KeeSiDB9jnMYnHwA7X7IW5feQpyNGUP/TTvWqkTfX0pGWJfvP609plke1qpxaxwIhACB r30A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hmaj3eR9gYFpeffsggau1qZxLLMy4vt6uo4tJjg8Abw=; b=T3gGuL+BfPgAxoB/TGteNRjlqXtRb8403eWBhsxsopGyU+wWmzxlrDnC+JWhIoIBtZ oh8YBEKOaq7lhddKJYI6ml51D0gseNGmfU+l8LmUQe3BAGrziPPCB6JUaQzt3TmAfLdJ aQPpSHZfNG63KIHc9f1zm0uMqJoOS0CN+S87Dm2UOai6pxNtO4Qe9SveH6/dGY79H2JW F/zgjnfOVZ5/SSEO7UHxHLX144oW//OmgvdPTJxPOwAHNWILdVjky9FUBa/1ykgGU3NR j3BFUZFPIi/UZe82/eOUkfGMaCEIXtY64rC75Q4LOIvpeZIO5S4vxSS8k3GO0LjOaKV6 u+9w== X-Gm-Message-State: AOPr4FUTp9NS3PmUOkC4AzZqPaPu0as1piE+OhLJN1rwng7V3GwDQuphZRzHzRfaiyMaMQ== X-Received: by 10.28.10.196 with SMTP id 187mr4155189wmk.76.1461681002621; Tue, 26 Apr 2016 07:30:02 -0700 (PDT) Received: from grapefruit (xdsl-87-78-18-28.netcologne.de. [87.78.18.28]) by smtp.gmail.com with ESMTPSA id h124sm3469083wmf.7.2016.04.26.07.30.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 07:30:02 -0700 (PDT) Received: by grapefruit (Postfix, from userid 1000) id A25AA6E067; Tue, 26 Apr 2016 16:30:00 +0200 (CEST) Date: Tue, 26 Apr 2016 16:30:00 +0200 From: Timo Buhrmester To: David Banning Cc: questions@freebsd.org Subject: Re: deleting /tmp files from crontab Message-ID: <20160426143000.GA18932@grapefruit.localdomain> References: <20160426123012.GA57555@skytracker.ca> <571F63B3.4040803@gmail.com> <20160426141301.GA62352@skytracker.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160426141301.GA62352@skytracker.ca> User-Agent: Mutt/1.5.24 (2015-08-30) 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:30:04 -0000 > > # 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. A common idiom is ``find ... -print0 | xargs -0 rm -r''. Note that -print0 and xargs -0 aren't POSIX, but I'm not aware of implementations lacking those.