sendmail设置定时发邮件举例
#sendmail_report.sh
#/bin/sh
export MAILRC=/home/ftpuser/test/pcreport/bin/wjl.rc
cd /home/ftpuser/test/pcreport
today=`date +"%Y%m%d"`
mv *.tar.gz history
tar -czvf check_$today.tar.gz *_check_$today.* > mailfile.txt
rm /home/ftpuser/test/pcreport/*_check_*.txt
mail -s "system daily check $today report" ***@*** -a check_$today.tar.gz < mailfile.txt
wjl.rc文件
set *** smtp=gzdc.eciq.cn *** smtp-auth-password=password smtp-auth=login
阅读(2968) | 评论(0) | 转发(0) |