#!/bin/sh
file=/home/www/syslog.txt
echo -e "\n" > $file
echo -e "\n" "write by snowtty the log create time is at: `date +%Y-%m-%d" "%T`" >> $file
echo -e "\n\n" >> $file
cur=/opt/messagesoft/smg/data/log
year=`date +%Y`
month=`date +%m`
day=`date +%d`
dir=$cur/$year/$month/$day/MTADELIVERY
cat $dir/* |egrep "spam-hits"|sort +4|awk '{printf("%-4s\b\b%s\b\b%-42s\t%-35s\t%s\b%s\n" ,NR,$2,$4,$5,$15,$NF)}' \
>> $file
echo -e "\n" >> $file
echo Create end at `date +%Y-%m-%d" "%T` >> $file
阅读(2474) | 评论(0) | 转发(0) |