|
rotatelogs - Rotating Web Server Log Files
Use rotatelogs to Rotate Your Web Server Log
Files. Basically, rotatelogs is a wrapper that you include in the Log
definitions in your web server configuration file.
Installation
To install rotatelogs, follow the instructions that correspond to your Virtual Private
Server O/S.
FreeBSD &
Solaris
rotatelogs is unavailable. Try
savelogs or
cronolog.
BSD/OS Upgrade!
In order to use the rotatelogs wrapper you must copy rotatelogs onto your server.
Connect to your Virtual Private Server via Telnet or
SSH and execute the following command.
% cp /usr/local/bin/rotatelogs ~/usr/local/bin
Huh?
If you don't know the Virtual Private Server O/S, try the following:
Usage
For example, to rotate your web server access log, you might include something like the following
in your Web Server Configuration File
(~/www/conf/httpd.conf).
TransferLog "|/usr/local/bin/rotatelogs /www/logs/access_log 86400"
This creates the files ~/www/logs/access_log.nnnn where nnnn is the system time
at which the log starts (system time is the number of seconds that have elapsed since January 1,
1970). At the end of each rotation time (here after 24 hours) a new log is started.
You can rotate the other web server log files as well.
AgentLog "|/usr/local/bin/rotatelogs /www/logs/agent_log 86400"
RefererLog "|/usr/local/bin/rotatelogs /www/logs/referer_log 86400"
ErrorLog "|/usr/local/bin/rotatelogs /www/logs/error_log 86400"
|