Date: Tue, 29 May 2001 11:18:02 -0700 From: Edwin Culp <eculp@encontacto.net> To: Jan Knepper <jan@digitaldaemon.com> Cc: Simon <simon@optinet.com>, FreeBSD-ISP <freebsd-isp@FreeBSD.ORG> Subject: Re: Log file rotation with Apache. Message-ID: <991160282.3b13e7da2d2c4@Mail.CafeMania.Net> In-Reply-To: <3B13D9D2.5060100@digitaldaemon.com> References: <20010529171239.CB61837B43C@hub.freebsd.org> <3B13D9D2.5060100@digitaldaemon.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Probably a bit simplistic but it has worked for me for a long time. I just run
it out of crontab everynight at 11:59 and it doesn't touch apache.
#!/bin/sh
DATE=`date +%Y%m%d`
LOGFILES="httpd-access.log httpd-error.log
LOGDIR="/var/log"
for i in $LOGFILES
do
cp /$LOGDIR/$i /$LOGDIR/$i.$DATE
>/$LOGDIR/$i
/usr/bin/gzip /$LOGDIR/$i.$DATE
done
Of course you can build on this.:-)
ed
Quoting Jan Knepper <jan@digitaldaemon.com>:
> Well what I want to solve is the size of the log files.
> What I remember from the Webalizer docco is that it will scan .gz log
> files.
> I run Apache and Webalizer on the same .log files and have not seen any
> problems with that yet.
>
> What my current problem is is that I would like to rotate the apache log
> files without having to touch apache.
>
> Jan
>
>
>
> Simon wrote:
>
> > What we do is rename *.log to *.log.resolve, restart apache, run webalizer
> on *.log.resolve.
> >
> > -Simon
> >
> > On Tue, 29 May 2001 13:05:32 -0400, Jan Knepper wrote:
> >
> >> Hi!
> >>
> >> Does any of you know about a "clean" way to do log file for Apache
> >> without disrupting webalizer?
> >>
> >> I have tried to just run newsyslog on them as I would like this best,
> >> but Apache seems to stop logging after the first trim. I know I can
> >> reset Apache with a "kill -1", but don't think that's exactly the way I
> >> would like to resolve that problem.
> >>
> >> Thanks!
> >> Jan
> >>
> >>
> >> To Unsubscribe: send mail to majordomo@FreeBSD.org
> >> with "unsubscribe freebsd-isp" in the body of the message
> >>
> >
> >
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-isp" in the body of the message
> >
> >
> >
>
>
-----------------------------------------------------------------------
The illiterate of the 21st century will not be
those who cannot read and write,
but those who cannot learn, unlearn and relearn.
--Alvin Toffler
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?991160282.3b13e7da2d2c4>
