Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- if [ -z "$1" ] ; then
- echo "Usage: $(basename $0) Jan|Feb|..|Dec"
- exit 1
- fi
- for i in `seq 1 31`; do
- day=$i/$1/2016
- list=$(sudo grep "$day" /var/log/apache2/access.log | awk '{print $1}'| grep -v '::1' | sort | uniq --count --repeated | sort --numeric-sort | tail -n 3)
- if [ ! -z "$list" ] ; then
- echo "$day: "
- echo "$list"
- fi
- done
Add Comment
Please, Sign In to add comment