From owner-cvs-all Thu Jun 8 10:38: 2 2000 Delivered-To: cvs-all@freebsd.org Received: from storm.FreeBSD.org.uk (storm.freebsd.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id DA9EE37BA8D; Thu, 8 Jun 2000 10:37:44 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (hak.nat.Awfulhak.org [172.31.0.12]) by storm.FreeBSD.org.uk (8.9.3/8.9.3) with ESMTP id SAA58959; Thu, 8 Jun 2000 18:37:33 +0100 (BST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id SAA20584; Thu, 8 Jun 2000 18:37:29 +0100 (BST) (envelope-from brian@Awfulhak.org) Message-Id: <200006081737.SAA20584@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Clive Lin Cc: Valentin Nechayev , Brian Somers , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, brian@hak.lan.Awfulhak.org Subject: Re: cvs commit: src/etc/periodic/daily 110.clean-tmps In-Reply-To: Message from Clive Lin of "Thu, 08 Jun 2000 21:15:49 +0800." <20000608211549.A7556@cartier.cirx.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 08 Jun 2000 18:37:29 +0100 From: Brian Somers Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > So, I suggest (yeah, just suggest..) put $clear_tmp_daily and related > stuffs into rc.conf and let this periodic script be consistent with it... > > Regards, > Clive How about something more like this: if [ -n "$clear_daily_days" ] then echo "" echo "Removing old temporary files:" set -f noglob args="-atime +$clear_daily_days -mtime +$clear_daily_days" [ -n "$clear_daily_ignore" ] && args="$args "`echo " ${clear_daily_ignore% }" | sed 's/[ ][ ]*/ ! -name /g'` for dir in $clear_daily_dirs do [ "${dir#/}" = "$dir" ] && continue # Only absolute directories [ -d $dir ] && cd $dir && { find -d . -type f $args -delete find -d . ! -name . -type d -mtime +$clear_daily_days -delete } done set -f glob fi With this in defaults/rc.conf: clear_daily_ignore=".X*-lock quota.user quota.group" # Don't delete these clear_daily_dirs="/tmp /var/tmp /compat/linux/tmp" # Delete stuff here clear_daily_days= # Older than this (3?) and rc.conf.5 updated accordingly ? -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message