摘要:
filename=`date +%Y%m%d_%H%M%S`
database=finebw
servername=official
createfilename=${servername}_${database}_${filename}
mysqldump -uroot -pfishjoy123456 ${database}>/mnt/mysql_data_bak/${createfilename}.sql
cd /mnt/mysql_data_bak
tar -zcvf ${createfilename}.tar.gz ${createfilename}.sql
rm -rf /mnt/mysql_data_bak/${createfilename}.sql 阅读全文