httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corp <ec...@corp.electracide.net>
Subject Re: [users@httpd] Question on bin/rotatelogs
Date Thu, 09 Jan 2003 22:11:49 GMT
I should have specified this was needed for hundreds of servers. So, I
cant use logrotate/cron to do this. I do use in cron currently a script
which runs before anything else and sleeps for a random period of time
then runs a custom rotation script I have. Problem is I cant have each and
every web server to be bounced at the same time :) And the reason why I
want to move away from cron and my custom rotate script is that then I
also need to grep out the prior days hits(since recall I cant bounce each
server at the same time, so there are bounces that happen at 6am in the
morning).

So, what I was hopefully looking for was something I can pipe the log into
so it can log a days hits, then automagically log the next days hits into
another log file. This will do away with my custom rotate script, and the
random sleep script, and a script which grabs a days hits.

Any ideas?

THanks.

On Thu, 9 Jan 2003, Jacob Coby wrote:

> 
> > So, this will log a 24hour period into that file. What I want to be able
> > to do, if possible, is only log one days hits into one log file(example,
> > only 09/Jan/2003. The on midnight start to log to a new file for
> > 10/Jan/2003).
> 
> Couple of options:
> 
> 1) use logrotate(8) along with a cron that runs at midnight.  Only thing you
> need to remember here is that post_rotate you need to sig -HUP to reset
> apache, and that whatever_log.1 will be the previous 24hr's log.
> 
> 2) use a script to cp your log file to log.`date -I`, and then cat /dev/null
> > log file to reset it.
> 
> 1) is more reliable
> 2) doesn't reset apache and cause your uptime to show < 24hrs or cause
> anything to actually reload.  You will lose whatever events happen between
> the cp and the cat /dev/null (maybe one or two lines)
> 
> -Jacob
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message