发送前一天的监控日志
#!/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=http://www.likecs.com/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
Linux mail发送邮件
内容版权声明:除非注明,否则皆为本站原创文章。