2 דקות ב BASH
תודה על הרעיון
קוד:
#!/bin/bash
# Author: Yonatan Pingle
# contact: yonatan.pingle "at" gmail.com
# Date: 19/12/2010
#
# how many visitors we had on our website ?
#
# this check's how many unique IP addresses were logged by apache on our website Today
#
# Add this to your daily cronjob at /etc/cron.daily/
# chmod +x uniqvis.sh
#
uni=`which uniq`
c=`which wc`
yom=`date +%d/%b/%Y`
logfile=/var/log/httpd/access_log
kama=`/bin/grep $yom $logfile | $uni | $c -l`
/bin/echo on $yom we had $kama visitors
# to create a log , un comment the following:
# echo "on $yom we had $kama visitors" >> /var/log/visitors.log
#
# get creative and phrase out to html , to have a nice web based log tracker.