diff options
author | Adam Spragg <adam@spra.gg> | 2018-06-25 13:01:59 +0100 |
---|---|---|
committer | Adam Spragg <adam@spra.gg> | 2018-06-25 13:01:59 +0100 |
commit | 6fb76294b98d81fb707445770dd57f0fb356deb9 (patch) | |
tree | 1123a093b7bfd699d0d79222587f4bba0c3d39a9 | |
parent | b830fd2107fd092a9c4f749b88b68412046758ab (diff) |
Remove PII (IP addresses) from the awstats data
Been meaning to do this for a while now.
-rwxr-xr-x | daily.sh | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 \ |