X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fmysql;h=b6a2f2ab9c83b1c4af01256f4ddfc5a1d5b3f49d;hb=b20a71c8f0880184e303d69c717ea29259666295;hp=9cf3c3d3f595e3281bd7837952fc5080f84a5264;hpb=44d16aaa322bf493a7d872d18873d2f47cfcf0ab;p=matthijs%2Fupstream%2Fbackupninja-vserver.git diff --git a/handlers/mysql b/handlers/mysql index 9cf3c3d..b6a2f2a 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -59,7 +59,7 @@ else then fatal "User $user not found in /etc/passwd" fi - userhome="$VROOTDIR/$vsname$userhome" + userhome="$vroot$userhome" info "User home set to: $userhome" [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf" else @@ -81,8 +81,8 @@ for i in $ignores; do ignore="$ignore --ignore-table=$i" done -# create backup dirs, vroot variable will be empty if no vsname was specified -# and will proceed to operate on the host +# create backup dirs, $vroot will be empty if no vsname was specified +# and we will instead proceed to operate on the host [ -d $vroot$backupdir ] || mkdir -p $vroot$backupdir [ -d $vroot$backupdir ] || fatal "Backup directory '$vroot$backupdir'" hotdir="$backupdir/hotcopy" @@ -120,8 +120,11 @@ then if [ $usevserver ] then home=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'` + home="$vroot$home" + info "Home set to: $home" else home=`getent passwd "root" | awk -F: '{print $6}'` + info "Home set to: $home" fi [ -d $home ] || fatal "Can't find root's home directory ($home)." mycnf="$home/.my.cnf" @@ -151,7 +154,7 @@ EOF umask $oldmask defaultsfile="--defaults-file=$mycnf" elif [ "$userset" == "false" ]; then - # if user is set, don't use $configfile + # if user is set, don't use $mycnf defaultsfile="--defaults-file=$configfile" fi