shell 实例。。。ing
jiqi=(01 02 03 04 05 06 07 08 09 10 11 12 13 14)
for((d=4;d<11;d++))
do
year=`date --date="$d day ago" +%Y`
month=`date --date="$d days ago" +%m`
day=`date --date="$d days ago" +%d`
for((i=0;i<14;i++))
do
if [ ${jiqi[${i}]} -ne '01' ] && [ ${jiqi[${i}]} -ne '03' ]
then
lzop -dcf $year$month/$year$month$day/input_shouji_access_log.$year$month${day}22.resin${jiqi[${i}]}* |head -n7000 |awk '{print $4}'|sort|uniq -c|sort -nr >> /search/odin/resin/WebContent/shellscript/jiankong/$year$month$day.log
fi
done
done
-------------------------------------------