You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by alexus <ml...@db.nexgen.com> on 2002/02/26 16:56:49 UTC

rotatelogs


c# /usr/local/apache/bin/rotatelogs
Usage: /usr/local/apache/bin/rotatelogs <logfile> <rotation time in seconds>
[offset minutes from UTC]

Add this:

TransferLog "|/usr/local/apache/bin/rotatelogs /some/where 86400"

to httpd.conf. The generated name will be /some/where.nnnn where nnnn is the
system time at which the log nominally starts (N.B. this time will always be
a
multiple of the rotation time, so you can synchronize cron scripts with it).
At the end of each rotation time a new log is started.
c#

after using this software i got those

%ls -al transfer_log.1014*
-rw-r--r--  1 root  alexus  21221 Feb 21 18:55 transfer_log.1014249600
-rw-r--r--  1 root  alexus  81912 Feb 22 18:45 transfer_log.1014336000
-rw-r--r--  1 root  alexus  22944 Feb 23 18:44 transfer_log.1014422400
-rw-r--r--  1 root  alexus   8893 Feb 24 18:31 transfer_log.1014508800
-rw-r--r--  1 root  alexus  34471 Feb 25 18:45 transfer_log.1014595200
-rw-r--r--  1 root  alexus  28190 Feb 26 10:40 transfer_log.1014681600
%

dates is all kind of different, is there a way to use crontab type
rotations?
basically like i want to do it once a month or so, and i'll put that amount
of seconds that goes in month
first of all some monthes are longer and some are shorter and second i'm not
quite sure if i won't need to restart my computer during this month so
apache will start again and going start that count from the time i start
apache.

also that system time, can it be changed to somethin more understandable for
users? users can't understand which file goes where, and especially those
who used little bit more advanced those logs, they wrote their scripts i can
suggest them look at the dates but that wasn't a good idea, is there a way
to change format.

also is there a way to make old log to tar/gzip so it'd take less space on
hard drive? and also keep only last 7 logs (one full week) and delete
others?

any suggestions/comments/recommendations on that?



---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


RE: rotatelogs

Posted by Joshua Slive <jo...@slive.ca>.
> From: alexus [mailto:ml@db.nexgen.com]

> dates is all kind of different, is there a way to use crontab type
> rotations?
> basically like i want to do it once a month or so, and i'll put
> that amount
> of seconds that goes in month
> first of all some monthes are longer and some are shorter and
> second i'm not
> quite sure if i won't need to restart my computer during this month so
> apache will start again and going start that count from the time i start
> apache.

No.  You can either investigate cronolog, or, more simply, just use crontab
to move the logs and gracefully restart the server.  In other words, forget
piped logging and just role your own simple log rotation script.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org