Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2001 08:37:21 -0400
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        Paul Branston <apbran@rannoch.demon.co.uk>, David Okeby <david@okeby.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: shell script to remove dated files
Message-ID:  <01082808372107.26623@i8k.babbleon.org>
In-Reply-To: <20010828110441.C31370@rannoch.demon.co.uk>
References:  <FMEEKJADHLBHCKHGCEKEOEOPCEAA.david@okeby.com> <20010828110441.C31370@rannoch.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01082808372107.26623>