mysql: Warn when vsname is set but vserver support is disabled in backupninja.conf.
[matthijs/upstream/backupninja.git] / handlers / mysql.in
index fe1e7832f32ee43c090cf5e17d6e985e040f8376..d22ef26c99d4cd926bffd3c7f32297664f08702f 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
 
@@ -39,6 +40,8 @@ if [ $vservers_are_available = yes ]; then
    else
       info "No vserver name specified, actions will be performed on the host."
    fi
+else
+   [ -z "$vsname" ] || warning 'vservers support disabled in backupninja.conf, vsname configuration line will be ignored'
 fi
 
 ## Prepare ignore part of the command
@@ -245,7 +248,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"