统计搜索引擎的每小时抓取量及首页抓取量(第一版)
2015-05-27 18:11
253 查看
下一版,要改进为在一个AWK内统计出所有数据。
现在要六次循环,效率太差,暂时跑起来先。。
现在要六次循环,效率太差,暂时跑起来先。。
#/bin/sh log_path="xxx.log" log_self="xxx.log" key_search=("http://www.baidu.com/search/spider.html" "http://www.google.com/bot.html" "http://www.haosou.com/help") time_inter_minute=60 bool_sendmail="true" last_time=`date "-d -${time_inter_minute} minute" '+%d/%b/%G:%H:%M:%S'` now_time=`date '+%d/%b/%G:%H:%M:%S'` now_time_str="[${now_time}" last_time_str="[${last_time}" echo > $log_self echo "start time: " $last_time >> $log_self echo "end time: " $now_time >> $log_self function searchSum() { shell_out=`awk -v a=$1 -v b=$2 '{if ($4 > a && $4 < b) print}' $3|grep $4|wc -l` echo $shell_out } function searchRootSum() { shell_root_out=`awk -v a=$1 -v b=$2 '{if ($4 > a && $4 < b && $7 == "/") print}' $3|grep $4|wc -l` echo $shell_root_out } for search_robot in ${key_search[@]} do echo $search_robot >> $log_self count=`searchSum $last_time_str $now_time_str $log_path $search_robot` echo 全站抓取数量:$count >> $log_self countRoot=`searchRootSum $last_time_str $now_time_str $log_path $search_robot` echo 首页抓取数量:$countRoot >> $log_self if [ $count -eq 0 ];then mutt -s "xxx搜索引擎抓取统计" x@x.com < $log_self fi done if [ $bool_sendmail == "true" ];then echo $bool_sendmail fi mutt -s "xxx搜索引擎抓取统计" xx@xx.com < $log_self
相关文章推荐
- PHP统计nginx访问日志中的搜索引擎抓取404链接页面路径
- PHP统计nginx访问日志中的搜索引擎抓取404链接页面路径
- 统计APP启动时间和进入首页时间的多线程类
- 搜索引擎Nutch源代码研究之一+网页抓取(2)
- 第25次中国互联网络发展状况统计报告 搜索引擎成为第三大网络应用
- 博客园外挂之一Web搜索引擎命中统计
- Improve博客园搜索引擎命中统计功能
- 有效引导搜索引擎 抓取优化网站内部链接
- python抓取新浪首页的小例子
- AJAX内容抓取-搜索引擎篇
- 对搜索引擎开源项目的代码分析——文档抓取
- 7月国内流量入口统计:搜索引擎24.64%居第三
- 百度能否够统计非搜索引擎流量
- #小练习 使用正则抓取oschina博客专区首页数据 分类: python 小练习 正则表达式 2013-11-11 17:22 604人阅读 评论(0) 收藏
- 关于网站流量统计中搜索引擎关键词
- 运维笔记40 Linux系统监控之Cacti(Cacti搭建,自动抓取cacti统计图片脚本)
- 什么样的网站设计有利于搜索引擎抓取页面
- 搜索引擎是怎么抓取支付宝信息 - A5站长
- 如何让搜索引擎抓取AJAX内容解决方案
- 模拟搜索引擎(蜘蛛)抓取页面