#created by taiyang
v_username='root'
if [ $v_username != 'root' ];then
echo "ERROR:the script must be run as mysql"
exit 1
fi
mysql -uroot -proot test < /root/b.sql > /root/b.txt
aa=`sed -n '2,1p' /root/b.txt`
if [ $aa -eq 0 ];then
echo "$aa"
else
echo "aabb"
echo "The test table has 90 values"|mail -s danger of mail xxxxxxxxx@163.com,xxxxx@139.com ------采用移动的139邮箱进行短信提醒
fi
#delete backups before 5 days
#echo "数据库中出现90的值!"|mail -s 邮件警告 1022xiyang@163.com,xxxxxx@139.com
#find $BackupPath -ctime +5 -name '*.bak' -exec rm {} \;
You have new mail in /var/spool/mail/root
[root@master ~]
v_username='root'
if [ $v_username != 'root' ];then
echo "ERROR:the script must be run as mysql"
exit 1
fi
mysql -uroot -proot test < /root/b.sql > /root/b.txt
aa=`sed -n '2,1p' /root/b.txt`
if [ $aa -eq 0 ];then
echo "$aa"
else
echo "aabb"
echo "The test table has 90 values"|mail -s danger of mail xxxxxxxxx@163.com,xxxxx@139.com ------采用移动的139邮箱进行短信提醒
fi
#delete backups before 5 days
#echo "数据库中出现90的值!"|mail -s 邮件警告 1022xiyang@163.com,xxxxxx@139.com
#find $BackupPath -ctime +5 -name '*.bak' -exec rm {} \;
You have new mail in /var/spool/mail/root
[root@master ~]