Date: Tue, 16 Dec 2008 23:04:23 GMT From: Vladimir Chukharev <chukharev@mail.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/129697: periodic/daily/100.clean-disks and port lang/sbcl Message-ID: <200812162304.mBGN4NWK023001@www.freebsd.org> Resent-Message-ID: <200812162310.mBGNA2bI013196@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 129697 >Category: misc >Synopsis: periodic/daily/100.clean-disks and port lang/sbcl >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Dec 16 23:10:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Vladimir Chukharev >Release: FreeBSD 7.1-PRERELEASE i386 >Organization: >Environment: FreeBSD chu.me.tut.fi 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Sat Dec 13 11:26:37 EET 2008 root@chu.me.tut.fi:/usr/obj/usr/src/sys/CHU i386 >Description: FreebBSD port lang/sbcl installs a file /usr/local/lib/sbcl/sbcl.core This file has the name corresponding to the core dumps and it gets deleted by a cron job /etc/periodic/daily/100.clean-disks if enabled in /etc/periodic.conf. >How-To-Repeat: Install the port lang/sbcl and enable the cron job by setting in /etc/periodic.conf : daily_clean_disks_enable="YES" daily_clean_disks_days=0 As root, run /etc/periodic/daily/100.clean-disks The file /usr/local/lib/sbcl/sbcl.core will be deleted. >Fix: The attached patch introduces a new variable daily_clean_disks_ignore where the port can put a list of files to be kept, e.g. in periodic.conf: daily_clean_disks_ignore="sbcl.core" I hope that the port maintainer will add this line e.g. to the port message when the patch is applied. Comments? Patch attached with submission follows: --- /etc/periodic/daily/100.clean-disks 2007-12-24 12:11:21.000000000 +0200 +++ progs/100.clean-disks 2008-12-17 00:50:59.000000000 +0200 @@ -29,10 +29,18 @@ echo "" echo "Cleaning disks:" set -f noglob - args="$args -name "`echo "$daily_clean_disks_files" | + args="$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 ! ( -name "`echo "$daily_clean_disks_ignore" | + sed -e 's/^[ ]*//' \ + -e 's/[ ]*$//' \ + -e 's/[ ][ ]*/ -o -name /g'`" )" + fi case "$daily_clean_disks_verbose" in [Yy][Ee][Ss]) @@ -41,9 +49,9 @@ 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) + command="find / ( ! -fstype local -o -fstype rdonly ) -a -prune -o \ + ( $args ) -atime +$daily_clean_disks_days -delete $print " + rc=$($command | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812162304.mBGN4NWK023001>