Skip to content
Snippets Groups Projects
Commit 0b8ac4f4 authored by Bob Mottram's avatar Bob Mottram
Browse files

Keep database running during backup and restore

parent 32a0727b
No related branches found
No related tags found
No related merge requests found
......@@ -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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment