From owner-freebsd-questions Tue Aug 28 3: 5:28 2001 Delivered-To: freebsd-questions@freebsd.org Received: from rannoch.demon.co.uk (rannoch.demon.co.uk [158.152.110.117]) by hub.freebsd.org (Postfix) with ESMTP id 78CF037B405 for ; Tue, 28 Aug 2001 03:05:24 -0700 (PDT) (envelope-from apbran@rannoch.demon.co.uk) Received: (from apb@localhost) by rannoch.demon.co.uk (8.11.4/8.10.1) id f7SA4g923898; Tue, 28 Aug 2001 11:04:42 +0100 (BST) Date: Tue, 28 Aug 2001 11:04:41 +0100 From: Paul Branston To: David Okeby Cc: freebsd-questions@freebsd.org Subject: Re: shell script to remove dated files Message-ID: <20010828110441.C31370@rannoch.demon.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from david@okeby.com on Tue, Aug 28, 2001 at 05:31:44AM +0800 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 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 {} \; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message