整理tuscany.org.cn的服务器,发现3年前写的脚本还在跑着 :)
脚本如下:
#==========================================================
#!/bin/bash
current_date=`date +%Y-%m-%d:%H:%M:%S`
/usr/local/mysql/bin/mysqldump -prootpass dbname1 > ./DB_DIR/dbname1_"$current_date"_dump_file.sql
/usr/local/mysql/bin/mysqldump -prootpass dbname2 > ./DB_DIR/dbname2_"$current_date"_dump_file.sql
scp /root/DB_DIR/dbname1_"$current_date"_dump_file.sql sca@172.90.91.92:/root/DBBakDir
scp /root/DB_DIR/dbname2_"$current_date"_dump_file.sql sca@172.91.92.93:/root/DBBakDir
if [ $? -ne 0 ]
then
mail -s "Warning mesage from the automating backup program of tuscany.org.cn" wanghongwei@myce.net.cn < mailcontext.txt
fi
#==========================================================
mailcontext.txt的内容
==================================
Tuscany数据备份出错,请尽快查看原因并解决!
分享到:
2010-01-07 15:12
浏览 471
评论