I am seeing a problem on my server where awstats is deleting data from previous days. To be clear the data was being shown for these days up until the end of the month but then on the next month (not always on the 1st) about 1-2 weeks of data suddenly goes missing from the previous month. This happens every month.
I assume it is a problem with log rotation but it's hard to tell. The problem might be caused by the logresolvemerge tool (I have seperate logs for regular and SSL traffic). My awstats configuration is:
LogFile="/usr/share/awstats/tools/logresolvemerge.pl /var/log/httpd/[sitename]-sslaccess.log /var/log/httpd/[sitename]-access.log |"
Logrotate is configured as (/etc/logrotate.d/apache2):
/var/log/apache2/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if /etc/init.d/apache2 status > /dev/null ; then \
/etc/init.d/apache2 reload > /dev/null; \
fi;
endscript
prerotate
/usr/local/bin/update.awstats.sh
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi;
endscript
}
/usr/local/bin/update.awstats.sh:
AWSTATSBINDIR=/usr/lib/cgi-bin/
AWSTATSCFGDIR=/etc/awstats
# Loop over configs
/usr/local/bin/awstats_updateall.pl now -awstatsprog=$AWSTATSBINDIR/awstats.pl -configdir=$AWSTATSCFGDIR
/usr/local/bin/awstats_updateall.pl is just the script from the awstats examples directory. It all seems pretty standard to me so I have no idea why stats just go missing AFTER they have been generated.
I've also notice that awstats has nearly 8000 awstats.[date].tmp.[number]
files in /val/lib/awstats/ for just one month on a server running only 2 domains. That seems excessive and possibly related to my issue? The tmp files have the permissions: