-#######################################################################
-## HOT COPY
-
-if [ "$hotcopy" == "yes" ]
-then
- info "Initializing hotcopy method"
- if [ "$databases" == "all" ]
- then
- if [ $usevserver = yes ]
- then
- info "dbhost: $dbhost"
- execstr="$VSERVER $vsname exec $MYSQLHOTCOPY -h $dbhost --quiet --allowold --regexp /.\*/./.\*/ $hotdir"
- else
- execstr="$MYSQLHOTCOPY --quiet --allowold --regexp /.\*/./.\*/ $hotdir"
- fi
- debug "su $user -c \"$execstr\""
- if [ ! $test ]
- then
- output=`su $user -c "$execstr" 2>&1`
- code=$?
- if [ "$code" == "0" ]
- then
- debug $output
- info "Successfully finished hotcopy of all mysql databases"
- else
- warning $output
- warning "Failed to hotcopy all mysql databases"
- fi
- fi
- else
- for db in $databases
- do
- if [ $usevserver = yes ]
- then
- execstr="$VSERVER $vsname exec $MYSQLHOTCOPY --allowold $db $hotdir"
- else
- execstr="$MYSQLHOTCOPY --allowold $db $hotdir"
- fi
- debug 'su $user -c \"$execstr\"'
- if [ ! $test ]
- then
- output=`su $user -c "$execstr" 2>&1`
- code=$?
- if [ "$code" == "0" ]
- then
- debug $output
- info "Successfully finished hotcopy of mysql database $db"
- else
- warning $output
- warning "Failed to hotcopy mysql database $db"
- fi
- fi
- done
- fi
-fi
+ debug "User home set to: $userhome"
+ [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
+ defaultsfile="--defaults-extra-file=$vuserhome/.my.cnf"
+ debug "using $defaultsfile"
+ fi
+
+ #######################################################################
+ ## HOT COPY
+
+ if [ "$hotcopy" == "yes" ]
+ then
+ info "Initializing hotcopy method"
+ if [ "$databases" == "all" ]
+ then
+ info "dbhost: $dbhost"
+ execstr="$vexec $MYSQLHOTCOPY -h $dbhost --quiet --allowold --regexp /.\*/./.\*/ $hotdir"
+
+ debug "su $user -c \"$execstr\""
+ if [ ! $test ]
+ then
+ output=`su $user -c "$execstr" 2>&1`
+ code=$?
+ if [ "$code" == "0" ]
+ then
+ debug $output
+ info "Successfully finished hotcopy of all mysql databases"
+ else
+ warning $output
+ warning "Failed to hotcopy all mysql databases"
+ fi
+ fi
+ else
+ for db in $databases
+ do
+ execstr="$vexec $MYSQLHOTCOPY -h $dbhost --allowold $db $hotdir"
+
+ debug 'su $user -c \"$execstr\"'
+ if [ ! $test ]
+ then
+ output=`su $user -c "$execstr" 2>&1`
+ code=$?
+ if [ "$code" == "0" ]
+ then
+ debug $output
+ info "Successfully finished hotcopy of mysql database $db"
+ else
+ warning $output
+ warning "Failed to hotcopy mysql database $db"
+ fi
+ fi
+ done
+ fi
+ fi