summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2018-06-25 13:01:59 +0100
committerAdam Spragg <adam@spra.gg>2018-06-25 13:01:59 +0100
commit6fb76294b98d81fb707445770dd57f0fb356deb9 (patch)
tree1123a093b7bfd699d0d79222587f4bba0c3d39a9
parentb830fd2107fd092a9c4f749b88b68412046758ab (diff)
Remove PII (IP addresses) from the awstats data
Been meaning to do this for a while now.
-rwxr-xr-xdaily.sh8
1 files 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 \