From owner-freebsd-bugs@FreeBSD.ORG Sun Nov 22 19:20:04 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6A4106566C for ; Sun, 22 Nov 2009 19:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 944B98FC1B for ; Sun, 22 Nov 2009 19:20:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nAMJK4RX012100 for ; Sun, 22 Nov 2009 19:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nAMJK42O012099; Sun, 22 Nov 2009 19:20:04 GMT (envelope-from gnats) Date: Sun, 22 Nov 2009 19:20:04 GMT Message-Id: <200911221920.nAMJK42O012099@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: chukharev@mail.ru Cc: Subject: Re: conf/129697: [patch] fix misbehavior of periodic/daily/100.clean-disks vs. port lang/sbcl X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: chukharev@mail.ru List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 19:20:04 -0000 The following reply was made to PR conf/129697; it has been noted by GNATS. From: chukharev@mail.ru To: bug-followup@freebsd.org Cc: Subject: Re: conf/129697: [patch] fix misbehavior of periodic/daily/100.clean-disks vs. port lang/sbcl Date: Sun, 22 Nov 2009 21:18:47 +0200 The old patch worked for me for at least six months with no problems. Then I made something in Windows (the machine is dual boot notebook), and found the following. The windows filesystem is automatically mounted by gnome, it is not marked as read-only but write operations on it are not allowed. So it is scanned by 100.clean-disks resulting in messages in mails like rm: #SharedObjects: Operation not supported A new version of the patch includes one more variable, daily_clean_disks_prune, containing a list of directories to ignore with all their subdirectories. Additionally, the new variables get empty strings as default values and comments document meaning of the variables in /etc/defaults/periodic.conf. NB. The script is off by default, thus the patch is not changing the default behavior. Perhaps, "/media" (or even "/media /mnt") is a better default for daily_clean_disks_prune. The file has mixed tabs and spaces, this might be nice to fix in a separate cosmetic patch. === --- etc/defaults/periodic.conf.orig 2009-06-25 16:49:49.000000000 +0300 +++ etc/defaults/periodic.conf 2009-11-17 12:28:35.000000000 +0200 @@ -40,6 +40,8 @@ daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*" daily_clean_disks_days=3 # If older than this daily_clean_disks_verbose="YES" # Mention files deleted +daily_clean_disks_prune="" # Directories to ignore +daily_clean_disks_ignore="" # Files to ignore # 110.clean-tmps daily_clean_tmps_enable="NO" # Delete stuff daily --- etc/periodic/daily/100.clean-disks.orig 2009-10-24 18:20:24.000000000 +0300 +++ etc/periodic/daily/100.clean-disks 2009-11-17 16:15:06.000000000 +0200 @@ -29,10 +29,18 @@ echo "" echo "Cleaning disks:" set -f noglob - args="-name "`echo "$daily_clean_disks_files" | + args="( -name "`echo "$daily_clean_disks_files" | sed -e 's/^[ ]*//' \ -e 's/[ ]*$//' \ - -e 's/[ ][ ]*/ -o -name /g'` + -e 's/[ ][ ]*/ -o -name /g'`" )" + + if ! [ -z "$daily_clean_disks_ignore" ] + then + args="$args -a ! ( -path "`echo "$daily_clean_disks_ignore" | + sed -e 's/^[ ]*//' \ + -e 's/[ ]*$//' \ + -e 's/[ ][ ]*/ -o -path /g'`" )" + fi case "$daily_clean_disks_verbose" in [Yy][Ee][Ss]) @@ -41,9 +49,19 @@ print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \ - \( $args \) -atime +$daily_clean_disks_days \ - -execdir rm -df {} \; $print | tee /dev/stderr | wc -l) + if ! [ -z "$daily_clean_disks_prune" ] + then + prune="-o -path "`echo "$daily_clean_disks_prune" | + sed -e 's/^[ ]*//' \ + -e 's/[ ]*$//' \ + -e 's/[ ][ ]*/ -o -path /g'` + else + prune="" + fi + + command="find / ( ! -fstype local -o -fstype rdonly $prune ) -prune -o ( \ + ( $args ) -atime +$daily_clean_disks_days -execdir rm -df {} ; $print )" + rc=$($command | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob === -- Vladimir Chukharev Tampere University of Technology