mail, mailx usage ,may be helpful
1、将文件内容作为邮件正文发送
mailx -s 'Title' xxx@xxx.com < copy.log
或者
cat /dbtmp/copy.log |mailx -s 'Title' xxx@xxx.com
把copy.log内容作为邮件正文发送
2、截取文件的部分内容作为正文发送
tail -100 /home/oraprod/backuparch.log |mailx -s 'title' xxx@xxx.com
截取backuparch.log的后100行作为正文发送
2、在邮件标题中加入时间
mailx -s "`date "+%Y/%m/%d"` rman log of finance prod" xxx@xxx.com
`date "+%Y/%m/%d"`表示2011/11/30
在此基础上,将copy.log内容作为邮件正文发送
mailx -s "`date "+%Y/%m/%d"` rman log of finance prod" xxx@xxx.com < /dbtmp/copy.log
在此基础上,将backuparch.log的后100行作为正文发送
tail -100 /home/oraprod/backuparch.log |mailx -s "`date "+%Y/%m/%d"` rman log of finance prod" xxx@xxx.com