cszer

a shell

分类: 工作相关, 技术, shell   标签:    评论: 0   阅读:4,371 views

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#caishzh create 20120425
 
ID="$1"
LOG="/var/log/maillog"
MAIL=$(mailq|grep "$ID"|awk '{print $7}')
 
[ "$MAIL" ] || exit 0
 
EML="/tmp/$MAIL.eml"
SENTLOG="/tmp/$MAIL.log"
 
postcat -q $ID >$EML || exit 0
 
grep $MAIL $LOG|grep nrcpt >$SENTLOG
 
[ -f "$EML" ] && sz $EML
[ -f "$SENTLOG" ] && sz $SENTLOG

除非注明,文章皆由( csz )原创,转载请标明本文地址
本文地址: http://www.cszhi.com/20120425/a-shell-script.html

04-25
2012

发表评论