Webalizer mit Logrotate
Aus Cryptronic
Webalizer mit Logrotate
Um Webalizer mit Logrotate laufen lassen zu können braucht man:
logrotate webalizer
Nach erfolgreicher Installation:
Datei /etc/logrotate.d/syscp erstellen:
/var/kunden/logs/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f /var/run/apache.pid ]; then \
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d apache reload > /dev/null; \
else \
/etc/init.d/apache reload > /dev/null; \
fi; \
fi;
endscript
}
Danach schauen wann cron.daily ausgeführt wird in /etc/crontab:
Auf folgende Werte setzen:
30 0 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
Nun ein neustarten des cron
/etc/init.d/cron restart
Nun webalizer beibringen, dass er alte logs behalten muss:
In /etc/webalitzer.conf nach Incremental suchen und auf yes stellen:
# Incremental processing allows multiple partial log files to be used # instead of one huge one. Useful for large sites that have to rotate # their log files more than once a month. The Webalizer will save its # internal state before exiting, and restore it the next time run, in # order to continue processing where it left off. This mode also causes # The Webalizer to scan for and ignore duplicate records (records already # processed by a previous run). See the README file for additional # information. The value may be 'yes' or 'no', with a default of 'no'. # The file 'webalizer.current' is used to store the current state data, # and is located in the output directory of the program. Incremental yes # IncrementalName allows you to specify the filename for saving the # incremental data in. It is similar to the HistoryName option where the # name is relative to the specified output directory, unless an absolute # filename is specified. The default is a file named "webalizer.current" # kept in the normal output directory. If you don't specify "Incremental" # as 'yes' then this option has no meaning. IncrementalName webalizer.current
nun noch ein Apache neustart
/etc/init.d/apache reload
und schon läuft alles