getconf dbhost localhost
getconf hotcopy no
getconf sqldump no
+getconf sqldumpoptions "--lock-tables --complete-insert --add-drop-table --quick --quote-names"
getconf compress yes
getconf vsname
fatal "The vserver given in vsname ($vsname) does not exist."
fi
# is it running ?
- $VSERVERINFO -q $vsname RUNNING
- if [ $? -ne 0 ]; then
- fatal "The vserver $vsname is not running."
- fi
+ vservers_running $vsname || fatal "The vserver $vsname is not running."
# everything ok
info "Using vserver '$vsname'."
usevserver=yes
for db in $databases
do
- DUMP_BASE="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names"
+ DUMP_BASE="$MYSQLDUMP $defaultsfile $sqldumpoptions"
# Dumping structure and data
DUMP="$DUMP_BASE $ignore $db"
if [ $usevserver = yes ]
then
# Test to make sure mysqld is running, if it is not sqldump will not work
- $VSERVER $vsname exec su $user -c "$MYSQLADMIN $defaultsfile ping"
+ $VSERVER $vsname exec su $user -c "$MYSQLADMIN $defaultsfile ping 2>&1 >/dev/null"
if [ $? -ne 0 ]; then
- fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!"
+ fatal "mysqld doesn't appear to be running!"
fi
if [ "$compress" == "yes" ]; then
execstr="$VSERVER $vsname exec $DUMP | $GZIP > $vroot$dumpdir/${db}.sql.gz"
fi
else
# Test to make sure mysqld is running, if it is not sqldump will not work
- su $user -c "$MYSQLADMIN $defaultsfile ping"
+ su $user -c "$MYSQLADMIN $defaultsfile ping 2>&1 >/dev/null"
if [ $? -ne 0 ]; then
- fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!"
+ fatal "mysqld doesn't appear to be running!"
fi
if [ "$compress" == "yes" ]; then
execstr="$DUMP | $GZIP > $dumpdir/${db}.sql.gz"