Date: Mon, 11 May 1998 12:25:37 +1000 From: "Andrew Specht" <andrew@iaccess.com.au> To: "Greg Lehey" <grog@lemis.com>, <freebsd-questions@FreeBSD.ORG> Subject: Re: gzip and date??? Message-ID: <02c001bd7c84$15e81320$e34a05cb@alpine.iaccess>
next in thread | raw e-mail | index | archive | help
cool thanks... i just did that and it works :) Andrew Specht | System Administrator E-mail: andrew@iaccess.com.au | Internet Access Australia Internet: http://www.iaccess.com.au | Melbourne, Australia -----Original Message----- From: Greg Lehey <grog@lemis.com> To: Andrew Specht <andrew@iaccess.com.au>; freebsd-questions@FreeBSD.ORG <freebsd-questions@FreeBSD.ORG> Date: Monday, May 11, 1998 12:17 PM Subject: Re: gzip and date??? >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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?02c001bd7c84$15e81320$e34a05cb>