X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fmysql.helper;fp=handlers%2Fmysql.helper;h=765f22889350b88e133605aefa1125e1ce7ad37d;hb=4c8e2839949be4603fbb8fb9e7a7e536e59c1dc4;hp=0000000000000000000000000000000000000000;hpb=2046272df5e3efeb8c6174b77c807ed40a2e3bd1;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/mysql.helper b/handlers/mysql.helper new file mode 100644 index 0000000..765f228 --- /dev/null +++ b/handlers/mysql.helper @@ -0,0 +1,109 @@ + +do_mysql_user() { + inputBox "mysql action wizard" "specify a system user:" + do_mysql_final "user = $REPLY" +} + +do_mysql_password() { + inputBox "mysql action wizard" "specify a mysql user:" + user=$REPLY + inputBox "mysql action wizard" "specify the mysql user's password:" + password=$REPLY + do_mysql_final "dbusername = $user\ndbpassword = $password" +} + +do_mysql_debian() { + _DISABLE_HOTCOPY=yes + do_mysql_final "configfile = /etc/mysql/debian.cnf" +} + +do_mysql_user() { + inputBox "mysql action wizard" "what system user does mysql backup use?" + do_mysql_final "user = $REPLY" +} + +do_mysql_final() { + if [ -z "$_DISABLE_HOTCOPY" ]; then + checkBox "mysql action wizard" "check options" \ + "sqldump" "create a backup using mysqldump (more compat)." off \ + "hotcopy" "create a backup using mysqlhotcopy (faster)." on \ + "compress" "compress the sql output files" on + status=$? + sqldump="sqldump = off" + hotcopy="hotcopy = off" + else + checkBox "mysql action wizard" "check options" \ + "compress" "compress the sql output files" on + status=$? + sqldump="sqldump = on" + hotcopy="hotcopy = off" + fi + + [ $status = 1 ] && return; + result="$REPLY" + compress="compress = off" + for opt in $result; do + case $opt in + '"sqldump"') sqldump="sqldump = on";; + '"hotcopy"') hotcopy="hotcopy = on";; + '"compress"') compress="compress = on";; + esac + done + get_next_filename $configdirectory/20.mysql + echo -e $@ > $next_filename + cat >> $next_filename < $helptmp <