Add support of databases from more than one MySQL installation.

This commit is contained in:
2018-01-23 02:54:48 +01:00
parent e4d5f59252
commit 83bd3db9b9
5 changed files with 37 additions and 6 deletions

View File

@ -266,9 +266,24 @@ if [ "$found" = "true" -o "$pgsql_backup" = "true" -o "$mysql_backup" = "true"
$script_dir/svn_backup.sh
fi
if $mysql_backup ;then
echolog "\nGoing to backup mysql databases.. ( `$date +%H`:`$date +%M` h )"
export mysql_user mysql_password mysql_credential_args mysql_gzip
$script_dir/mysql_backup.sh
if [[ ${#mysql_credential_args_arr[@]} -gt 0 ]] ; then
for _val in "${mysql_credential_args_arr[@]}" ; do
IFS=':' read -a _val_arr <<< "${_val}"
mysql_version="${_val_arr[0]}"
mysql_credential_args="${_val_arr[1]}"
echolog "\nGoing to backup mysql databases ${_val_arr[0]} .. ( `$date +%H`:`$date +%M` h )"
export mysql_version mysql_credential_args mysql_gzip
$script_dir/mysql_backup.sh
done
else
echolog "\nGoing to backup mysql databases.. ( `$date +%H`:`$date +%M` h )"
export mysql_user mysql_password mysql_credential_args mysql_gzip
$script_dir/mysql_backup.sh
fi
## - !!
if $restart_apache ;then
$ssh ${ssh_user}@$srcHost "sudo /etc/init.d/apache2 restart"