#!/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