*BSD News Article 86253


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!netcom.com!kientzle
From: kientzle@netcom.com
Subject: Re: Newbie: Rotating logfile monthly
Message-ID: <kientzleE3ID4w.1L3@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: <5ah9su$bsk@eve.enteract.com>
Date: Sat, 4 Jan 1997 23:55:44 GMT
Lines: 23
Sender: kientzle@netcom15.netcom.com
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:33629

In article <5ah9su$bsk@eve.enteract.com>,
Dannyman  <dannyman@dannyland.org> wrote:
>Wanna rotate my Apache access_log, and other similiar such beasties,
>every month. Basically, rename the thing with the likes of
>access_log-[jan-dec]-1997, etc and maybe run compress on it.

The traditional way is documented in /etc/monthly, where it rotates
other log files.  While you could cook up something with `date',
you might find it more trouble than it's worth.

>file. I've noticed that when you run compress as an apendesque
>operation(sorry, it's been a while) that you don't get compression on
>all the data. ie, I had a multi-megabyte log that when compressed hit

Ummm...  tacking the output of `compress' onto existing data doesn't
sound like a good idea to me, if you want to be able to uncompress
the data again.  How about:

(uncompress <oldfile.Z ; cat newfile) | compress > newfile.Z
rm oldfile.Z newfile


                                        - Tim Kientzle