#!/bin/sh
d=`/bin/date --date="1 day ago" "+%Y-%m-%d"`
if [ $# -gt 0 ]
then
d=$1
fi
if [ $# -gt 1 ]
then
address=$2
fi
if [ $# -gt 2 ]
then
sid=$3
fi
if [ $# -gt 3 ]
then
pname=$4
fi
dir="/backup/log/XXX.log."
dir1="/backup/X.X.X.X/mevent-"
dir2="/backup/X.X.X.X/mevent-"
fw=`grep "${address}" ${dir}$d |cut -d "]" -f3 | tr -d " [" | sort | wc -l`
dl=`grep "${address}" ${dir}$d |cut -d "]" -f3 | tr -d " [" | sort | uniq | wc -l`
dz=`grep "$sid" ${dir1}$d.log ${dir2}$d.log | grep "action:1" | wc -l`
aa="$aa<table width="587" height="93" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF"><tr align="center" valign="middle" bgcolor="#99CCFF"><td height="32" colspan="3"><FONT size=2><FONT color=#0000ff>$pname</FONT></FONT>($d)</td></tr><tr align="center" valign="middle" bordercolor="#CCCCCC"><td width="193" height="30" bgcolor="#FFCCFF">访问量</td><td width="193" bgcolor="#FFFF99">独立用户数</td><td width="193" bgcolor="#00FFFF"><font color="#000000">定制数</font></td></tr><tr align="center" valign="middle" bordercolor="#CCCCCC"><td height="29" bgcolor="#FFCCFF" align=center>$fw</td><td bgcolor="#FFFF99" align=center>$dl</td><td bgcolor="#00FFFF" align=center>$dz</td></tr></table></br>";
echo $aa;
*:注意涉及机密部分用X代替