# which databases to backup. should either be the word 'all' or a
# space separated list of database names.
$mysql_databases
EOF
if [ $host_or_vservers == vservers ]
then
cat >> $next_filename <<EOF
#
# vsname = <vserver> (no default)
# vsname indicates which vserver to operate on, this is only used if
# vserver is set to yes in /etc/backupninja.conf
# NOTE: if you do not specify a vsname the host will be operated on
# alsoNOTE: if operating on a vserver, $VROOTDIR will be
# prepended to backupdir.
EOF
echo -e "$mysql_vsname\n" >> $next_filename
fi
echo -e $@ >> $next_filename
chmod 600 $next_filename
}
mysql_wizard() {
# Global variables
mysql_title="MySQL action wizard"
# backup the host system or a Vserver?
choose_host_or_one_vserver "$mysql_title"
[ $? = 0 ] || return 1
if [ $host_or_vservers == vservers ]
then
do_mysql_vserver
[ $? = 0 ] || return 1
fi
# backupdir
if [ $host_or_vservers == vservers ]
then
inputBox "$mysql_title" "Directory where to store the backups:`echo \"\n(Relative to chosen vserver's root directory)\"`" "/var/backups/mysql"
else
inputBox "$mysql_title" "Directory where to store the backups" "/var/backups/mysql"
fi
[ $? = 1 ] && return
mysql_backupdir="backupdir = $REPLY"
# databases
booleanBox "$mysql_title" "Do you want to backup all of the databases? `echo \"\n\nIf not, you'll be offered to choose individual databases to backup.\"`"
if [ $? = 0 ]; then
mysql_databases="databases = all"
else
do_mysql_databases
[ $? = 0 ] || return 1
fi
while true; do
_DISABLE_HOTCOPY=
menuBoxHelpFile "mysql action wizard" "choose a mysql authentication method:" \
menuBoxHelpFile "$mysql_title" "choose a mysql authentication method:" \
user "change to a linux user first." \
password "manually specify mysql user and password." \