update log processing

This commit is contained in:
Ben Harris 2017-11-15 13:46:02 -05:00
parent acad053ee3
commit 1a32e216ea
3 changed files with 13 additions and 2 deletions

5
.gitignore vendored
View File

@ -18,6 +18,7 @@ images/*
!images/itunes_image.jpg
!images/smiley_default_freebox.png
stats/
stats/stats.html
video/
.goaccess.last
analytics/

4
stats/analyze_hdb_logs Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
/bin/zcat /var/log/apache2/heyderebub.com_access.log.*.gz | /usr/local/bin/goaccess --log-format=COMBINED -f /var/log/apache2/heyderebub.com_access.log -f /var/log/apache2/heyderebub.com_access.log.1 -o /var/www/heyderebub.com/public_html/stats/stats.html

6
stats/index.php Normal file
View File

@ -0,0 +1,6 @@
<?php
if (time() - filemtime("stats.html") > 1 * 3600)
exec("./analyze_hdb_logs");
echo file_get_contents("stats.html");