From owner-freebsd-questions Sun May 10 19:16:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA19056 for freebsd-questions-outgoing; Sun, 10 May 1998 19:16:58 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from freebie.lemis.com (freebie.lemis.com [139.130.136.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA19041 for ; Sun, 10 May 1998 19:16:43 -0700 (PDT) (envelope-from grog@lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id LAA08167; Mon, 11 May 1998 11:46:30 +0930 (CST) (envelope-from grog) Message-ID: <19980511114630.R7546@freebie.lemis.com> Date: Mon, 11 May 1998 11:46:30 +0930 From: Greg Lehey To: Andrew Specht , freebsd-questions@FreeBSD.ORG Subject: Re: gzip and date??? References: <02a601bd7c7f$42908420$e34a05cb@alpine.iaccess> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <02a601bd7c7f$42908420$e34a05cb@alpine.iaccess>; from Andrew Specht on Mon, May 11, 1998 at 11:50:48AM +1000 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 11 May 1998 at 11:50:48 +1000, Andrew Specht wrote: > hey, > > Would anyone know how to make gzip include the date in the zipped file? > > eg: > > cache.log >> cache.log.gz.050598 > > does that work? nothing in the man pages about it. gzip doesn't do this. It also doesn't normally recognize this kind of name as a gzip archive. There's nothing to stop you writing a wrapper, though, like: #!/bin/sh for i in $*; do gzip $i mv $i.gz $i.`date "+%d%m%y"`.gz done This will rename the file in your example to cache.log.050598.gz. Greg -- See complete headers for address and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message