diff options
author | intrigeri <intrigeri@boum.org> | 2010-08-26 02:04:13 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2010-08-26 02:04:13 +0200 |
commit | 93041732b3ccffa113693af8480d69fc080d9ec1 (patch) | |
tree | b2950b49cba6a22b448a7e88819c2ac6c26847ad /handlers/mysql.in | |
parent | e6c65815c8201d123f477e05a367832204c39886 (diff) | |
parent | 40155781065eb7254eb9fc9c48bd85b0b8ace4c0 (diff) | |
download | backupninja-93041732b3ccffa113693af8480d69fc080d9ec1.tar.gz backupninja-93041732b3ccffa113693af8480d69fc080d9ec1.tar.bz2 |
Merge branch 'master' into debian
Conflicts:
examples/example.ldap
Diffstat (limited to 'handlers/mysql.in')
-rw-r--r-- | handlers/mysql.in | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/handlers/mysql.in b/handlers/mysql.in index 3488c51..0282046 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -86,7 +86,7 @@ fi defaultsfile="" -if [ "$dbusername" != "" -a "$dbpassword" != "" ] +if [ -n "$dbusername" -a -n "$dbpassword" ] then if [ $usevserver = yes ] then @@ -140,13 +140,10 @@ password="$dbpassword" EOF umask $oldmask defaultsfile="--defaults-extra-file=$mycnf" -fi -# if a user is not set, use $configfile, otherwise use $mycnf -if [ "$user" == "" ]; then - user=root; - defaultsfile="--defaults-extra-file=$configfile" -else +# else, if a user is set use her .my.cnf +elif [ -n "$user" ] +then userset=true; if [ $usevserver = yes ] then @@ -169,6 +166,10 @@ else defaultsfile="--defaults-extra-file=$userhome/.my.cnf" debug "using $defaultsfile" +# otherwise use $configfile +else + user=root + defaultsfile="--defaults-extra-file=$configfile" fi ####################################################################### @@ -255,6 +256,10 @@ then for db in $databases do DUMP_BASE="$MYSQLDUMP $defaultsfile $sqldumpoptions" + if [ "$db" = "information_schema" ] + then + DUMP_BASE="${DUMP_BASE} --skip-lock-tables" + fi # Dumping structure and data DUMP="$DUMP_BASE $ignore $db" @@ -279,7 +284,7 @@ then fatal "mysqld doesn't appear to be running!" fi if [ "$compress" == "yes" ]; then - execstr="$VSERVER $vsname exec $DUMP | $GZIP --rsyncable > '$vroot$dumpdir/${db}.sql.gz'" + execstr="$VSERVER $vsname exec $DUMP | $GZIP $GZIP_OPTS > '$vroot$dumpdir/${db}.sql.gz'" else execstr="$VSERVER $vsname exec $DUMP -r '$vroot$dumpdir/${db}.sql'" fi @@ -290,7 +295,7 @@ then fatal "mysqld doesn't appear to be running!" fi if [ "$compress" == "yes" ]; then - execstr="$DUMP | $GZIP --rsyncable > '$dumpdir/${db}.sql.gz'" + execstr="$DUMP | $GZIP $GZIP_OPTS > '$dumpdir/${db}.sql.gz'" else execstr="$DUMP -r '$dumpdir/${db}.sql'" fi |