vi daypvuv.sh
#!/bin/bash
#set -x
day1=$(date +%F -d "-1 day")
day2=$(date +%F -d "-2 day")
day3=$(date +%F -d "-3 day")
day4=$(date +%F -d "-4 day")
day5=$(date +%F -d "-5 day")
day6=$(date +%F -d "-6 day")
cd /application/nginx/logs
echo "#############cang.mini-PV###############"
echo $(date +%F)
awk '{print $7}' cang.mini-kaola_access.log|wc -l
echo ${day1}
awk '{print $7}' cang.mini-kaola_access_${day1}.log|wc -l
echo ${day2}
awk '{print $7}' cang.mini-kaola_access_${day2}.log|wc -l
echo ${day3}
awk '{print $7}' cang.mini-kaola_access_${day3}.log|wc -l
echo ${day4}
awk '{print $7}' cang.mini-kaola_access_${day4}.log|wc -l
echo ${day5}
awk '{print $7}' cang.mini-kaola_access_${day5}.log|wc -l
echo ${day6}
awk '{print $7}' cang.mini-kaola_access_${day6}.log|wc -l
echo "############cang.mini-UV###############"
echo $(date +%F)
awk '{print $7}' cang.mini-kaola_access.log|sort|uniq -c|wc -l
echo ${day1}
awk '{print $7}' cang.mini-kaola_access_${day1}.log|sort|uniq -c|wc -l
echo ${day2}
awk '{print $7}' cang.mini-kaola_access_${day2}.log|sort|uniq -c|wc -l
echo ${day3}
awk '{print $7}' cang.mini-kaola_access_${day3}.log|sort|uniq -c|wc -l
echo ${day4}
awk '{print $7}' cang.mini-kaola_access_${day4}.log|sort|uniq -c|wc -l
echo ${day5}
awk '{print $7}' cang.mini-kaola_access_${day5}.log|sort|uniq -c|wc -l
echo ${day6}
awk '{print $7}' cang.mini-kaola_access_${day6}.log|sort|uniq -c|wc -l