nginx统计1

#!/bin/bash

logs_path="/usr/local/nginx/logs/"

#echo $logs_path

#echo $(date -d "yesterday" +"%Y")

#echo $(date -d "yesterday" +"%m")

#echo $(date -d "yesterday" +"%d")

mkdir -p ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/

#cp ${logs_path}access.91nbs.com.log ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d

 "yesterday" +"%m")/access.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d")

mv ${logs_path}access.91nbs.com.log ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d 

"yesterday" +"%m")/access.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d")

#echo $(cat /usr/local/webserver/nginx/nginx.pid)

 

kill -USR1 $(cat /usr/local/nginx/logs/nginx.pid)

 

nbsjc=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acces

s.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/nbsjc.exe" | wc -l)

nbsmf=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acces

s.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/nbsmf.exe" | wc -l)

nbstf=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acces

s.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/nbstf.exe" | wc -l)

nbsry=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acces

s.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/nbsry.exe" | wc -l)

tzpt18=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acce

ss.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/tzpt_18.exe" | wc -

l)

tzpt19=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acce

ss.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/tzpt_19.exe" | wc -

l)

tzpt20=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acce

ss.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/tzpt_20.exe" | wc -

l)

tzpt7=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acces

s.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/tzpt_7.exe" | wc -l)

tzptmf=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acce

ss.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/tzpt_mf.exe" | wc -

l)

nbspjb2=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acc

ess.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/nbspjb_2.exe" | wc

 -l)

nbspjb3=$(cat ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/acc

ess.91nbs.com.log.$(date -d "yesterday" +"%Y%m%d") | grep "GET /soft/nbspjb_3.exe" | wc

 -l)

 

#echo $cishu

 

/usr/sbin/sendmail -t <<EOF

From: statistical analysis <root@localhost>

To:bo.dong@cfdow.com;yang.liu@cfdow.com

#To:yang.liu@cfdow.com

Subject:statistical analysis download_software for 124.238.39.229

 

statistical analysis download_software for 124.238.39.229

 

$(date -d "yesterday" +"%Y%m%d") log

 

---------------------------------------

download | nbsjc.exe   | times: $nbsjc

---------------------------------------

download | nbsmf.exe   | times: $nbsmf

---------------------------------------

download | nbstf.exe   | times: $nbstf

---------------------------------------

download | nbsry.exe   | times: $nbsry

---------------------------------------

download | tzpt_18.exe | times: $tzpt18

---------------------------------------

download | tzpt_19.exe | times: $tzpt19

---------------------------------------

download | tzpt_20.exe | times: $tzpt20

---------------------------------------

download | tzpt_7.exe | times: $tzpt7

---------------------------------------

download | tzpt_mf.exe | times: $tzptmf

---------------------------------------

download | nbspjb_2.exe | times: $nbspjb2

----------------------------------------

download | nbspjb_3.exe | times: $nbspjb3

-----------------------------------------

 

 

cfdow_tech_liuyang

 

EOF

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值