Keep database running during backup and restore
This commit is contained in:
parent
32a0727ba4
commit
0b8ac4f4d1
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue