定时查看svn log,邮件自动通知

export LANG="en_US.UTF-8"
pridate=`date -d "-2 day" +%Y-%m-%d`
nowdate=`date -d "-1 day" +%Y-%m-%d`
#nowdate=`date +%Y-%m-%d`
echo $pridate
echo $nowdate

overseabranch1=http://svntrunkurl
overseabranch1log=content.log
echo "--------------------------------------------------------" >>$overseabranch1log
echo "This is an automated email, please don't reply!" >>$overseabranch1log
echo "--------------------------------------------------------" >>$overseabranch1log
echo "" >> $overseabranch1log
echo "==================" >> $overseabranch1log
echo "[Repository Url]" >> $overseabranch1log
echo "==================" >> $overseabranch1log
echo $overseabranch1 >> $overseabranch1log
echo "" >> $overseabranch1log
echo "===================================" >> $overseabranch1log
echo "[`echo $pridate`]--[`echo $nowdate`] svnlog" >> $overseabranch1log
echo "===================================" >> $overseabranch1log

svn log -v -r {$pridate}:{$nowdate} $overseabranch1 >>$overseabranch1log

subject="[`echo $pridate`][`echo $nowdate`]--[title]svnlog"
echo $subject
cat $overseabranch1log | mutt -s $subject [email protected]
rm $overseabranch1log


你可能感兴趣的:(笔记,svn,mutt,svnlog)