Cleanup old awstats data and html pages

neboysha

Verified User
Joined
Mar 4, 2022
Messages
13
Hello community,

anybody knows about possibility to clean up old awstats data and generated html pages for let say older than 365 days?

All I found are 2 oneliners like

find /home -type f -path "*/awstats/.data/awstats*.txt" -mtime +365 -print > old_awstats_data.txt

for txt files and

find /home -type f -path "*/awstats/*.html" -mtime +365 -print > old_awstats_html.txt

for html generated files

This is of course dry run for actual effective removing should replace -print with - delete and exclude > part.

It would be nice do it with tally with settings on root / user level how far older data should be kept.

Also as I disabled generating html files with custom awstats script

If you wish to increase system efficiency, you can disable the html files from being generated (as they are the bulk of the cpu-time) and have only the data files be computed. To do this, type:

cd /usr/local/directadmin/scripts/custom
cp ../awstats_process.sh .

edit the custom/awstats_process.sh, and set:

ADD_HTML=0

and the html files will no longer be generated, increasing performance.

from here https://docs.directadmin.com/change...revious-month-added-cgi-based-dynamic-awstats

can I now remove all html filles and index.html symlink from awstats folder?

Thanks for your attention
 
Back
Top