Strumenti Utente

Strumenti Sito


wiki:statistiche

Statistiche Apache

Sono disponibili giornalmente dopo la mezzanotte:

semplice codice per automatizzare le statistiche

httpd-prerotate
#!/bin/bash
#
# script /etc/logrotate.d/httpd-prerotate/rotate-1
 
logpath="/var/log/apache2"
statpath="/var/www/html/stats"
 
if [ -s $logpath/access.log.1 ]; then \
 rm $statpath/report-1.html \
 cat $logpath/access.log.1 | goaccess -a -o report.html >> $statpath/report-1.html ;\
fi; \
 
if [ -s $logpath/access.log ]; then \
 rm $statpath/report.html \
 cat $logpath/access.log | goaccess -a -o report.html >> $statpath/report.html ;\
fi; \
 
if [ -s $logpath/access.log.10.gz ]; then \
 rm $statpath/report1.html \
 zcat $logpath/access.log.[2-10].gz | goaccess -a -o report.html >> $statpath/report1.html ;\
fi; \
 
if [ -s $logpath/access.log.20.gz ]; then \
 rm $statpath/report2.html \
 zcat $logpath/access.log.[11-20].gz | goaccess -a -o report.html >> $statpath/report2.html ;\
fi; \
 
if [ -s $logpath/access.log.30.gz ]; then \
 rm $statpath/report3.html \
 zcat $logpath/access.log.[21-30].gz | goaccess -a -o report.html >> $statpath/report3.html ;\
fi; \
 
chown 33:33 $statpath/*.html
 
exit 0
wiki/statistiche.txt · Ultima modifica: 2019/12/01 20:03 (modifica esterna)