Re: rotatate logs - Apache has anyone got this to rotate at a specific time?

From: Dan Norris <dannorris_at_dannorris.com>
Date: Wed, 21 Oct 2009 09:31:37 -0500
Message-ID: <bc04324b0910210731w7cd1e788q1b116f5e7e14596c_at_mail.gmail.com>



I've successfully used this in the past:

ErrorLog "|/u01/Apache/Apache/bin/rotatelogs /u01/app/oracle/product/sso10g/Apache/Apache/logs/error_log.%Y%m%d 86400 -300"

Note the specification of an offset at the end, inside the quotes. That should work on 1.3 or 2.x, but it is a fixed interval from UTC, so you may have to adjust it to handle daylight savings time, etc. Using -300 as above, it will rotate at midnight UTC-5 hours (central time in summer). Adjust -300 as appropriate for your time zone. If you're lucky enough to have an environment that doesn't observe DST, you're all set!

Dan

On Wed, Oct 21, 2009 at 9:14 AM, kathy duret <katpopins21_at_yahoo.com> wrote:

> actual I have 2.2 on the one and it isn't working.
>
> the 1.3 is actually working better go figure.
>
> Kathy
>
> --- On *Mon, 10/19/09, Mark Weaver <mark-clist_at_npsl.co.uk>* wrote:
>
>
> From: Mark Weaver <mark-clist_at_npsl.co.uk>
> Subject: Re: rotatate logs - Apache has anyone got this to rotate at a
> specific time?
> To: "kathy duret" <katpopins21_at_yahoo.com>
> Cc: oracle-l_at_freelists.org, ora-apps-dba_at_freelists.org
> Date: Monday, October 19, 2009, 1:51 PM
>
> On 19/10/2009 7:37 PM, kathy duret wrote:
> > tried it on both Apache 1.3 and 2.0 no dice
> > 86400 basically rotates it every 24 hours.
> >
> As I said below, the rotate at midnight feature is only documented for
> apache >= 2.2. You either need a newer rotatelogs or a different method
> of log rotation.
>
> > I am having issues trying to even force a log rotation.
> > So much fun so little time.
> > kathy
> >
> > --- On *Fri, 10/16/09, Mark Weaver /<mark-clist_at_npsl.co.uk<http://us.mc382.mail.yahoo.com/mc/compose?to=mark-clist_at_npsl.co.uk>>/*
> wrote:
> >
> >
> > From: Mark Weaver <mark-clist_at_npsl.co.uk<http://us.mc382.mail.yahoo.com/mc/compose?to=mark-clist_at_npsl.co.uk>
> >
> > Subject: Re: rotatate logs - Apache has anyone got this to rotate at
> > a specific time?
> > To: katpopins21_at_yahoo.com<http://us.mc382.mail.yahoo.com/mc/compose?to=katpopins21_at_yahoo.com>
> > Cc: oracle-l_at_freelists.org<http://us.mc382.mail.yahoo.com/mc/compose?to=oracle-l_at_freelists.org>
> > Date: Friday, October 16, 2009, 4:30 PM
> >
> > On 16/10/2009 4:26 PM, kathy duret wrote:
> > > I am using the rotatelog function for my Apache logs.
> > > ErrorLog "|/u01/Apache/Apache/bin/rotatelogs
> > >
> > /u01/app/oracle/product/sso10g/Apache/Apache/logs/error_log.%Y%m%d
> > 86400"
> > > While this does rotate the logs every 24 hours with a datetime, I
> > > specifically need to have it run at midnight.
> > > Yes, I have an SR open and yet I posted to Apache forums.
> > > There is a transferlog function but I haven't been able to get
> > this to work
> > > I thought if I could manually force a rotate, then I could just
> cron
> > > this to go at midnight.
> >
> > Which version of apache is it?
> >
> > http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
> >
> > states that "if the rotation time is 86400, the log file will be
> > rotated every night at midnight", although:
> >
> > http://httpd.apache.org/docs/2.0/programs/rotatelogs.html
> >
> > does not. It should be easy enough to grab/use the rotatelogs from a
> > newer version of apache though.
> >
> > You also need to consider when midnight is -- it has options for
> > making it run in localtime or at specific UTC offsets, but by
> > default it runs in UTC.
> >
> >
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Oct 21 2009 - 09:31:37 CDT

Original text of this message