I've always rotated my logs without ever starting apache. I just do something like this.

cp access_log $date_access_log
echo > access_log
gzip $date_access_log

It's possible to lose a line or 2 of logging, but if that's ok, this is what I've done.

Robert Zajda wrote:
It's hosting server so restarting apache is bad idea.

On 5/15/07, John Mendenhall <[EMAIL PROTECTED]> wrote:
> If you don't mind a second or two of down time then you can use
> something like this in newsyslog.conf as a restart command:
>
> "apachectl stop;sleep 1;apachctl start;sleep 10;apachectl start"
>
> The first sleep gives apache a second to finish active requests before
> trying to start again.  The second sleep and start is to catch the case
> where the first start fails because apache is still running.

I have a script which does the following:

+ rotates logs
+ calls apachectl stop (twice, with sleep 2 after each call)
+ calls apachectl stop and greps the output to make sure it is stopped
  (looks for 'not running')
+ if I don't find not running, pages me
+ run apachectl startssl

This is all in a wrapper script which then calls awstats
after a successful rotate and restart.

Works for us.

JohnM

--
john mendenhall
[EMAIL PROTECTED]
surf utopia
internet services



--
Alex Thurlow
Technical Director
Blastro Networks

email: [EMAIL PROTECTED]
office: 512-485-3148
mobile: 512-762-5814

Reply via email to