Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2002 05:33:09 +0200
From:      Giorgos Keramidas <keramida@FreeBSD.org>
To:        ann kok <annkok2001@yahoo.com>
Cc:        Jan Grant <Jan.Grant@bristol.ac.uk>, questions <questions@FreeBSD.org>
Subject:   Re: crontab to backup mail in date format
Message-ID:  <20020116033309.GB25005@hades.hell.gr>
In-Reply-To: <20020116030821.GA25005@hades.hell.gr>
References:  <Pine.GSO.4.31.0201141625490.20828-100000@mail.ilrt.bris.ac.uk> <20020116024727.49626.qmail@web20108.mail.yahoo.com> <20020116030821.GA25005@hades.hell.gr>

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




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