eldy / AWStats

AWStats Log Analyzer project (official sources)
https://www.awstats.org
369 stars 120 forks source link

Awstats fills up /var/lib/awstats with 21G+ tmp files #106

Open soundasleep opened 6 years ago

soundasleep commented 6 years ago

We were alerted to our server running out of disk space. Turns out that the /var/lib/awstats folder (our data directory) was getting filled with tens of gigabytes of X.tmp.N files.

-rw-rw-r--  1 www-data www-data  245256 Jul  6 09:30 awstats072018.domain.com.tmp.9862
-rw-rw-r--  1 www-data www-data  324533 Jul  9 01:50 awstats072018.domain.com.tmp.9866
-rw-rw-r--  1 www-data www-data  154256 Jul  4 11:30 awstats072018.domain.com.tmp.9870
-rw-rw-r--  1 www-data www-data  344076 Jul  9 23:20 awstats072018.domain.com.tmp.9938
-rw-rw-r--  1 www-data www-data  261854 Jul  7 06:10 awstats072018.domain.com.tmp.9958
-rw-rw-r--  1 www-data www-data   59396 Jul  2 07:40 awstats072018.domain.com.tmp.9985
-rw-r--r--  1 root     root      375813 Jul 10 18:18 awstats072018.domain.txt

First question: We deleted all of the tmp files. Is this OK? We've had to update our script to automatically delete the .tmp files after completing, too:

/usr/lib/cgi-bin/awstats.pl -config=domain.com -update
/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=domain.com -dir=/var/www/domain.com/awstats/ -awstatsprog=/usr/lib/cgi-bin/awstats.pl -showcorrupted

# Have to add this so that we don't run out of disk space
cd /var/lib/awstats
find . -maxdepth 1 -name "*.tmp.*" -delete

(We had to use find instead of rm because there were too many for bash to handle.)

Second question: Why are these gigs of (ostensibly temporary) files being written into /var/lib/awstats? I couldn't find any configuration option to specify where to write temp files. May be related to #28.

visualperception commented 6 years ago

if awstats runs normaly tmp files are deleted at end of run. you must have had failures on date of tmp files

tmp files are created in same stats folder as specified in conf file as far as I know

visualperception commented 6 years ago

same data directory

(cant edit my previous post)