Keep database running during backup and restore

This commit is contained in:
Bob Mottram 2017-06-11 10:56:46 +01:00
parent 32a0727ba4
commit 0b8ac4f4d1
3 changed files with 3 additions and 0 deletions

View File

@ -305,6 +305,7 @@ function backup_mariadb {
if [ ! -d $temp_backup_dir ]; then
mkdir $temp_backup_dir
fi
keep_database_running
mysqldump --lock-tables --password="$DATABASE_PASSWORD" mysql user > $temp_backup_dir/mysql.sql
if [ ! -s $temp_backup_dir/mysql.sql ]; then
echo $"Unable to backup mysql settings"

View File

@ -305,6 +305,7 @@ function backup_mariadb {
if [ ! -d $temp_backup_dir ]; then
mkdir $temp_backup_dir
fi
keep_database_running
mysqldump --password=$DATABASE_PASSWORD mysql user > $temp_backup_dir/mysql.sql
if [ ! -s $temp_backup_dir/mysql.sql ]; then
echo $"Unable to backup MariaDB settings"

View File

@ -205,6 +205,7 @@ function restore_mariadb {
if [ -d $USB_MOUNT/backup/mariadb ]; then
echo $"Restoring mysql settings"
keep_database_running
temp_restore_dir=/root/tempmariadb
restore_directory_from_usb $temp_restore_dir mariadb
echo $'Obtaining MariaDB password'