啊啊好大好舒服av大鸡吧亚洲一区二乱,国产黄A三级三级在线看,熟女作爱一区二区视频,年龄最小的无码AⅤ在线观看,又黑又大又黄又爽国产,猛插女人视频网站,国产免费观看三级黄色,毛片一区二区三区四区五区在线视频 ,欧美顶级黄最新视频在线观看,高清在线一区二区

龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開發(fā),龍巖分銷系統(tǒng)

shell自動備份mysql數(shù)據(jù)庫

2016.01.14 | 1790閱讀 | 0條評論 | shell腳本


#!/bin/bash


#1.數(shù)據(jù)庫信息定義

echo  "Enter mysql password:"

read  PWD

mysql_host="localhost"

mysql_user="root"

mysql_passwd=$PWD


#sql備份目錄

back_dir="/home/bakdb"



if [ ! -d $back_dir ]; then

mkdir -p $back_dir

fi


#備份的數(shù)據(jù)庫數(shù)組

db_arr=$(echo "show databases;" | mysql -u$mysql_user -p$mysql_passwd -h$mysql_host)



#當(dāng)前日期

nowdate=`date +%Y-%m-%d`;



#2.進入到備份目錄

cd $back_dir

mkdir $nowdate

cd $nowdate



#3.循環(huán)備份

for dbname in ${db_arr}

do

   if [ "$dbname" = "information_schema" ] || [ "$dbname" = "Database" ] || [ "$dbname" = "test" ] || [ "$dbname" = "performance_schema" ] || [ "$dbname" = "mysql" ]; then

       echo "no"  

    else

       sqlfile=$dbname".sql"

       a=`mysqldump -u$mysql_user -p$mysql_passwd -h$mysql_host $dbname >$sqlfile`

       echo $dbname

   fi

done


贊 (

發(fā)表評論