1 HELPERS="$HELPERS mysql:mysql_database_backup"
4 inputBox "mysql action wizard" "specify a system user:"
6 do_mysql_final "user = $REPLY"
10 inputBox "mysql action wizard" "specify a mysql user:"
13 inputBox "mysql action wizard" "specify the mysql user's password:"
16 do_mysql_final "dbusername = $user\ndbpassword = $password"
21 do_mysql_final "configfile = /etc/mysql/debian.cnf"
25 inputBox "mysql action wizard" "what system user does mysql backup use?"
27 do_mysql_final "user = $REPLY"
31 if [ -z "$_DISABLE_HOTCOPY" ]; then
32 checkBox "mysql action wizard" "check options" \
33 "sqldump" "create a backup using mysqldump (more compat)." no \
34 "hotcopy" "create a backup using mysqlhotcopy (faster)." yes \
35 "compress" "compress the sql output files" yes
37 sqldump="sqldump = no"
38 hotcopy="hotcopy = no"
40 checkBox "mysql action wizard" "check options" \
41 "compress" "compress the sql output files" yes
43 sqldump="sqldump = yes"
44 hotcopy="hotcopy = no"
47 [ $status = 1 ] && return;
49 compress="compress = no"
50 for opt in $result; do
52 '"sqldump"') sqldump="sqldump = yes";;
53 '"hotcopy"') hotcopy="hotcopy = yes";;
54 '"compress"') compress="compress = yes";;
57 get_next_filename $configdirectory/20.mysql
58 echo -e $@ > $next_filename
59 cat >> $next_filename <<EOF
64 # backupdir = /var/backups/mysql
67 chmod 600 $next_filename
73 menuBoxHelpFile "mysql action wizard" "choose a mysql authentication method:" \
74 user "change to a linux user first." \
75 password "manually specify mysql user and password." \
76 debian "use default mysql user debian-sys-maint."
78 if [ $status = 2 ]; then
80 helptmp="/tmp/backupninja.help.$$"
82 To connect to mysql, backupninja must authenticate.
83 There are three possible authentication methods:
86 With this method, you specify a system user. Backupninja will
87 then become this user before running mysqldump or mysqlhotcopy.
88 The result is that ~/.my.cnf is used for authentication.
91 With this method, you manually specify a mysql user and
92 password in the backup action configuration.
95 With this method, we use the debian-sys-maint user which is
96 already defined in /etc/mysql/debian.cnf. If you are running
97 debian, this is recommended, because no further configuration
98 is needed. The drawback is that this is incompatible with
99 mysqlhotcopy: you must use mysqldump.
101 dialog --textbox $helptmp 0 0
105 [ $status = 1 ] && return;
108 "user") do_mysql_user;return;;
109 "password") do_mysql_password;return;;
110 "debian") do_mysql_debian;return;;