Commit adff22f7 authored by 智勇's avatar 智勇

update

parent f8682ed8
......@@ -13,6 +13,25 @@ work_dir=/home/qa-deploy-utils/db-utils
sync_config_folder=~/db_sync_configs
db_backup_folder=~/daily_db_backup
function valid_ip()
{
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
}
if valid_ip $ip_value; then target_db_host="$ip_value"; else target_db_host="192.168.4.$ip_value"; fi
function db_schema_sync()
{
database=$1
......@@ -33,7 +52,7 @@ function db_schema_sync()
sh $work_dir/db_gen_config.sh $source_db_host $source_db_user $source_db_pwd $target_db_host $target_db_user $target_db_pwd $database $config_file_name $db_backup_sub_folders false
}
database_list='cash_loan_flow contract dujiangyan financial_system financial_system_api fund_manage gyxd mall merchant notify offline payment_center qinqiong quartz redpacket risk_control silk_road spider_center user_credit xyqb xyqb_app xyqb_btzt xyqb_user'
database_list='cash_loan_flow contract dujiangyan financial_system financial_system_api fund_manage gyxd mall merchant notify offline payment_center qinqiong quartz redpacket risk_control silk_road spider_center traffic_distribution user_credit xyqb xyqb_app xyqb_btzt xyqb_user'
echo "database_list:${database_list}"
for db_name in $database_list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment