标签:
发送前一天的监控日志
#!/bin/bash source /etc/profile time=`date -d ‘-1 day‘ "+%Y%m%d"` #判断服务是否已经启动 ser=`/usr/bin/pgrep sendmail` if [ "$ser" != "" ] then echo "the service is running" else /etc/init.d/sendmail start fi #要发送的文件 file=/home/wlycle_uniq/data/send_head_data$time.info #收件人 array=(ex-hefeng600@pingan.com.cn aa@qq.com) for i in ${array[@]};do mail -s "玉衡短信发送内容定时跟踪" $i -r dbc@notice.com < $file if [ $? != 0 ]; then echo "step for mail is failed" exit 0 fi done
标签:
原文地址:http://www.cnblogs.com/tester-hehehe/p/5601296.html