From 62e29d5100fcdfbfba83515940453497d7c15e14 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 23 Jan 2018 03:58:02 +0100 Subject: [PATCH] Fix minor errors. --- hosts/scripts/mysql_backup.sh | 18 +++++++++++------- rcopy.sh | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/hosts/scripts/mysql_backup.sh b/hosts/scripts/mysql_backup.sh index 287f943..6fd8761 100755 --- a/hosts/scripts/mysql_backup.sh +++ b/hosts/scripts/mysql_backup.sh @@ -74,7 +74,11 @@ err_Log=${LOCK_DIR}/mysql.err.log # -------------------- Variable --------------------- # # -_backupDestArchiveDir="${script_backup_dir}/MySQL-${mysql_version}" +if [[ -n ${mysql_version} ]]; then + _backupDestArchiveDir="${script_backup_dir}/MySQL-${mysql_version}" +else + _backupDestArchiveDir="${script_backup_dir}/MySQL" +fi if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then @@ -329,6 +333,12 @@ if $ARCHIVE ;then ## - for i in $DATABASES ; do + if [ "$destHost" = "localhost" ]; then + if [ ! -d ${_backupDestArchiveDir}/${i} ] ; then + $mkdir -p ${_backupDestArchiveDir}/${i} + fi + fi + ## ------------------------------------ ## - Save Functions seperatly if exists ## - @@ -495,12 +505,6 @@ if $ARCHIVE ;then mysqldump_flags="$mysqldump_flags --events" fi - if [ "$destHost" = "localhost" ]; then - if [ ! -d ${_backupDestArchiveDir}/${i} ] ; then - $mkdir -p ${_backupDestArchiveDir}/${i} - fi - fi - info_msg="save database $i.." echononl "\t$info_msg" if [ $srcHost != "localhost" ] || $_via_ssh_tunnel ;then diff --git a/rcopy.sh b/rcopy.sh index dddbeef..edda4cf 100755 --- a/rcopy.sh +++ b/rcopy.sh @@ -198,6 +198,7 @@ fi ## - if $manual ; then host_scripts="${hosts_base_dir}/localhost.sh" + host_scripts="${hosts_base_dir}/www2.oopen.de.sh" else host_scripts=`$find $hosts_base_dir -maxdepth 1 -type f -perm -700 | $sort` fi