1 HELPERS="$HELPERS mysql:mysql_database_backup"
4 inputBox "mysql action wizard" "specify a system user:"
5 do_mysql_final "user = $REPLY"
9 inputBox "mysql action wizard" "specify a mysql user:"
11 inputBox "mysql action wizard" "specify the mysql user's password:"
13 do_mysql_final "dbusername = $user\ndbpassword = $password"
18 do_mysql_final "configfile = /etc/mysql/debian.cnf"
22 inputBox "mysql action wizard" "what system user does mysql backup use?"
23 do_mysql_final "user = $REPLY"
27 if [ -z "$_DISABLE_HOTCOPY" ]; then
28 checkBox "mysql action wizard" "check options" \
29 "sqldump" "create a backup using mysqldump (more compat)." off \
30 "hotcopy" "create a backup using mysqlhotcopy (faster)." on \
31 "compress" "compress the sql output files" on
33 sqldump="sqldump = off"
34 hotcopy="hotcopy = off"
36 checkBox "mysql action wizard" "check options" \
37 "compress" "compress the sql output files" on
39 sqldump="sqldump = on"
40 hotcopy="hotcopy = off"
43 [ $status = 1 ] && return;
45 compress="compress = off"
46 for opt in $result; do
48 '"sqldump"') sqldump="sqldump = on";;
49 '"hotcopy"') hotcopy="hotcopy = on";;
50 '"compress"') compress="compress = on";;
53 get_next_filename $configdirectory/20.mysql
54 echo -e $@ > $next_filename
55 cat >> $next_filename <<EOF
60 # backupdir = /var/backups/mysql
63 chmod 000 $next_filename
69 menuBoxHelpFile "mysql action wizard" "choose a mysql authentication method:" \
70 user "change to a linux user first." \
71 password "manually specify mysql user and password." \
72 debian "use default mysql user debian-sys-maint."
74 if [ $status = 2 ]; then
76 helptmp="/tmp/backupninja.help.$$"
78 To connect to mysql, backupninja must authenticate.
79 There are three possible authentication methods:
82 With this method, you specify a system user. Backupninja will
83 then become this user before running mysqldump or mysqlhotcopy.
84 The result is that ~/.my.cnf is used for authentication.
87 With this method, you manually specify a mysql user and
88 password in the backup action configuration.
91 With this method, we use the debian-sys-maint user which is
92 already defined in /etc/mysql/debian.cnf. If you are running
93 debian, this is recommended, because no further configuration
94 is needed. The drawback is that this is incompatible with
95 mysqlhotcopy: you must use mysqldump.
97 dialog --textbox $helptmp 0 0
101 [ $status = 1 ] && return;
104 "user") do_mysql_user;return;;
105 "password") do_mysql_password;return;;
106 "debian") do_mysql_debian;return;;