From owner-freebsd-questions Tue Aug 28 5:37:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail8.nc.rr.com (fe8.southeast.rr.com [24.93.67.55]) by hub.freebsd.org (Postfix) with ESMTP id 810B437B405 for ; Tue, 28 Aug 2001 05:37:46 -0700 (PDT) (envelope-from bts@babbleon.org) Received: from i8k.babbleon.org ([66.57.85.154]) by mail8.nc.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Tue, 28 Aug 2001 08:37:36 -0400 Content-Type: text/plain; charset="iso-8859-1" From: Brian T.Schellenberger To: Paul Branston , David Okeby Subject: Re: shell script to remove dated files Date: Tue, 28 Aug 2001 08:37:21 -0400 X-Mailer: KMail [version 1.2] Cc: freebsd-questions@FreeBSD.ORG References: <20010828110441.C31370@rannoch.demon.co.uk> In-Reply-To: <20010828110441.C31370@rannoch.demon.co.uk> MIME-Version: 1.0 Message-Id: <01082808372107.26623@i8k.babbleon.org> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tuesday 28 August 2001 06:04, Paul Branston wrote: > On Tue, Aug 28, 2001 at 05:31:44AM +0800, David Okeby wrote: > > Hi, > > > > How do I write a shell script that removes old files? Say something of > > the order of two weeks old. > > > > Thanks > > > > David > > david@okeby.com > > have a read at the find man page. You need somethimg like > > find /path -mtime +14 -exec rm {} \; I recommend -atime instead. THis way if they've been reading it, it won't vanish on them. Of course it depends on the purpose of the script. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Brian T. Schellenberger . . . . . . . bts@wnt.sas.com (work) Brian, the man from Babble-On . . . . bts@babbleon.org (personal) --------------------> Free Dmitry Sklyarov! <------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message