Przeglądaj źródła

Keep database running during backup and restore

Bob Mottram 7 lat temu
rodzic
commit
0b8ac4f4d1

+ 1
- 0
src/freedombone-backup-local Wyświetl plik

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

+ 1
- 0
src/freedombone-backup-remote Wyświetl plik

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

+ 1
- 0
src/freedombone-restore-local Wyświetl plik

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