Use cronolog for log conversion ..www.cronolog.org to obtain a new cronolog compilation. Install CustomLogusrlocalapache1.3logsaccess _ logcommon and change it to CustomLog | pai_log _ % wcommon
Use cronolog for log conversion .. http://www.cronolog.org/get new cronolog compilation. install and change CustomLog/usr/local/apache1.3/logs/access_log common to CustomLog "|/usr/local/sbin/cronolog/usr/local/apache1.3/logs/access_log _ % w" common puts ErrorLog/
ExploitationCronolog
Conversion..
Http://www.cronolog.org/
Get new cronolog
Compile. Install
Set CustomLog/usr/local/apache1.3/logs/access_log common
Change
CustomLog "|/usr/local/sbin/cronolog/usr/local/apache1.3/logs/access_log _ % w" common
Set ErrorLog/usr/local/apache1.3/logs/error_log
Change
ErrorLog "|/usr/local/sbin/cronolog/usr/local/apache1.3/logs/error_log _ % w"
Note: % w indicates the week of the year. For more information, see man cronolog. A new log is generated every week ..
Then run apache again. Use the graceful parameter:
/Usr/local/apache/bin/apachectl graceful
Use vi to edit a simple script
#! /Bin/bash
Find/usr/local/apache/logs/access *-mtime + 31-exec rm-f {}\;
Find/usr/local/apache/logs/error *-mtime + 31-exec rm-f {}\;
/Usr/local/apache/bin/apachectl graceful
This script allows the system to automatically delete files modified a month ago.
Then vi/etc/crontab
Add a row
* 3 ** 6 root/usr/local/apache/htdocs/ww/baksh/lograte. sh
This indicates that the edited script runs at every week.
Appendix: Meaning of five * in crontab ....
Minute
(0-59)
Hour
(0-23)
Date
(1-31)
Month
(1-12)
Bytes
(0-6)