首页 » 脚本 » 正文

tongjizhezicaijiqi.sh

#!/bin/bash
#统计折子采集器工作情况
a=`date -d yesterday +%d`
cd /data/logs/alicommission.zhezi.com/
nu=`less access-201406$a* |grep ‘r=site/index’ |wc -l`
cd /home/app/alicommission.zhezi.com/protected/runtime/
nd=`less * |grep ‘13426378197’ |grep ‘2014/06/’$a” |wc -l`
echo “总数为:$nu,没拿到数量为:$nd”
awk ‘BEGIN{printf “%.2f%\n”,(‘$nd’/’$nu’)*100}’