From owner-svn-src-head@FreeBSD.ORG Tue Jun 2 07:35:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF980106564A; Tue, 2 Jun 2009 07:35:51 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE6838FC17; Tue, 2 Jun 2009 07:35:51 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n527ZpbL006239; Tue, 2 Jun 2009 07:35:51 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n527Zppv006238; Tue, 2 Jun 2009 07:35:51 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906020735.n527Zppv006238@svn.freebsd.org> From: Brian Somers Date: Tue, 2 Jun 2009 07:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193302 - head/etc/periodic/daily X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 07:35:52 -0000 Author: brian Date: Tue Jun 2 07:35:51 2009 New Revision: 193302 URL: http://svn.freebsd.org/changeset/base/193302 Log: Rather than using both -prune (which requires directory-first tree traversal) and -delete (which implies depth-first traversal), avoid using -delete in favour of -execdir. This has a side-effect of not removing directories that contain files, even if we delete all of those files, but IMHO that's a better option than specifying all possible local filesystem types in this script. PR: 122811 MFC after: 3 weeks Modified: head/etc/periodic/daily/100.clean-disks Modified: head/etc/periodic/daily/100.clean-disks ============================================================================== --- head/etc/periodic/daily/100.clean-disks Tue Jun 2 06:55:32 2009 (r193301) +++ head/etc/periodic/daily/100.clean-disks Tue Jun 2 07:35:51 2009 (r193302) @@ -29,7 +29,7 @@ case "$daily_clean_disks_enable" in echo "" echo "Cleaning disks:" set -f noglob - args="$args -name "`echo "$daily_clean_disks_files" | + args="-name "`echo "$daily_clean_disks_files" | sed -e 's/^[ ]*//' \ -e 's/[ ]*$//' \ -e 's/[ ][ ]*/ -o -name /g'` @@ -41,9 +41,9 @@ case "$daily_clean_disks_enable" in print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ - \( $args \) -atime +$daily_clean_disks_days -delete $print | - tee /dev/stderr | wc -l) + rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \ + \( $args \) -atime +$daily_clean_disks_days \ + -execdir rm -df {} \; $print | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob