From owner-freebsd-questions Tue Jan 15 19:34: 4 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id A2E5D37B402 for ; Tue, 15 Jan 2002 19:34:01 -0800 (PST) Received: from hades.hell.gr (patr530-a002.otenet.gr [212.205.215.2]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id g0G3XRo10376; Wed, 16 Jan 2002 05:33:32 +0200 (EET) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id g0G3XAo31841; Wed, 16 Jan 2002 05:33:10 +0200 (EET) (envelope-from keramida@FreeBSD.org) Date: Wed, 16 Jan 2002 05:33:09 +0200 From: Giorgos Keramidas To: ann kok Cc: Jan Grant , questions Subject: Re: crontab to backup mail in date format Message-ID: <20020116033309.GB25005@hades.hell.gr> References: <20020116024727.49626.qmail@web20108.mail.yahoo.com> <20020116030821.GA25005@hades.hell.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020116030821.GA25005@hades.hell.gr> User-Agent: Mutt/1.3.25i 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 2002-01-16 05:08:22, Giorgos Keramidas wrote: > > Sort backup archives by date, and erase everything that is older than > 3 days. If you have files called: > > % ls -1 mail.* > mail.2002.01.08.tar.gz > mail.2002.01.09.tar.gz > mail.2002.01.10.tar.gz > mail.2002.01.11.tar.gz > mail.2002.01.12.tar.gz > > and you want to erase all but the 3 last, you can use commands like: > > % ls -1 mail.*.tar.gz | sort -3 | sed -e '1,3d' Of course that should read: sort -r Bleh, I should stop replying to mail after 03:00 am. -- Giorgos Keramidas . . . . . . . . . keramida@{ceid.upatras.gr,freebsd.org} FreeBSD Documentation Project . . . http://www.freebsd.org/docproj/ FreeBSD: The power to serve . . . . http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message