mysql: new sqldumpoptions config variable (Closes: #502966)
[matthijs/upstream/backupninja.git] / handlers / mysql.in
index defb72aa8aeb98713d807024a5a488bcbca43cdd..c80a36a3d95881ba0aa8b4f8ba5fd20ec3efce05 100644 (file)
@@ -10,6 +10,7 @@ getconf nodata
 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
 
@@ -31,10 +32,7 @@ if [ $vservers_are_available = yes ]; then
          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
@@ -248,7 +246,7 @@ then
 
        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"