From 6fb76294b98d81fb707445770dd57f0fb356deb9 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Mon, 25 Jun 2018 13:01:59 +0100 Subject: Remove PII (IP addresses) from the awstats data Been meaning to do this for a while now. --- daily.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daily.sh b/daily.sh index 2d15006..db50bf7 100755 --- a/daily.sh +++ b/daily.sh @@ -17,9 +17,11 @@ AWMON=`/bin/date -d yesterday +%m` # Run awstats $SITEROOT/awstats/awstats -config="$DOMAIN" -update 2>&1 | /usr/bin/ts "$TSFMT awstats:" >>$LOGFILE -# Remove any PII (e.g. IP addresses) from the awstats data -#AWDATA="$SITEROOT/awstats/data/awstats${AWMON}${AWYEAR}.txt" -#/bin/grep -E -v "^[[:digit:]]{1,3}\\.[[:digit:]]{1,3}\\.[[:digit:]]{1,3}\\.[[:digit:]]{1,3} [[:digit:]]" "$AWDATA" | /usr/bin/sponge "$AWDATA" +# Remove any PII (i.e. IP addresses) from the awstats data +AWDATA="$SITEROOT/awstats/data/awstats${AWMON}${AWYEAR}.txt" +/bin/grep -E -v "^[[:digit:]]{1,3}\\.[[:digit:]]{1,3}\\.[[:digit:]]{1,3}\\.[[:digit:]]{1,3} [[:digit:]]" "$AWDATA" \ + | /bin/sed -e "s/^BEGIN_VISITOR [[:digit:]]\\+\$/BEGIN_VISITOR 0/" \ + | /usr/bin/sponge "$AWDATA" #$SITEROOT/awstats/awstats_buildstaticpages.pl \ /usr/share/awstats/tools/awstats_buildstaticpages.pl \ -- cgit v1.2.1