View Single Post
ישן 19-12-10, 15:20   # 2
yonatan
I am root
 
yonatan's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: אשדוד
גיל: 39
הודעות: 3,911

yonatan לא מחובר  

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.
__________________
אחסון אתרים - Red Hat Certified
עקבו אחרינו בטוויטר!

  Reply With Quote