Applicable to:
- Plesk for Linux
Symptoms
Awstats *.txt
data files (such as ones stored under /var/www/vhosts/system/example.com/statistics/webstat
) are kept longer than set within the retention policy settings of the server/service plan/subscription:
- Tools & Settings > Server Settings > Retain web and traffic statistics for;
- Service Plans > plan_name > Logs & Statistics > Retain web and traffic statistics for;
- Subscriptions > example.com > Customize > Logs & Statistics > Retain web and traffic statistics for.
Cause
Product issue:
-
#PPPM-10655 "AWStats TXT files are now completely removed after the corresponding TTL has expired."
Fixed in:- Plesk Obsidian 15 September 2020 (Linux)
Resolution
Workaround
If update is not possible for some reason you may try the following
For GDPR compliant environment, use Webalizer with IP addresses anonymization.
As a workaround for AWStats on Linux server, use the following steps:
-
Connect to the server via SSH.
-
Create a script
/root/awstats_cleanup.sh
with the following content:CONFIG_TEXT: #!/bin/bash
for i in $(ls -d /var/www/vhosts/system/*/statistics/webstat*/); do
find $i -ctime +$1 -exec rm -rf {} +;
done
echo "Web statistics files older than" $1 "day(s) are removed";
exit -
Create a task with the following content in Tools & Settings > Scheduled Tasks:
CONFIG_TEXT: /bin/bash /root/awstats_cleanup.sh 90
Where 90 is the number of days to retain traffic statistics files.
Comments
2 comments
Hello,
Until this is fixed, is there any chance you folks could release a script, that I could run, manually, to remove the very old files (and directories) in "/var/www/vhosts/system/example.com/statistics/webstat" and "/var/www/vhosts/system/example.com/statistics/webstat-ssl" for each subscription?
Customers are going over their quotas because these large files are going back many years. The subscription I'm looking at right now has these files going back a decade, to 2010.
Also, where do I find the setting for "TTL of the Domain/Server" in regards to AWStats?
Best Regards,
Bob
Hello Bob,
Thank you for the questions.
I've updated the article with additional details and the script which can be used as a w/a for AWStats.
Please sign in to leave a comment.