From 496e52e97cedf9f7fa32008470d92eab0c3eeefe Mon Sep 17 00:00:00 2001 From: admin666 Date: Fri, 5 Aug 2022 15:00:42 +0200 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20bug=20mv=20backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- migrate_many_to_aunt.sh | 5 ++++- migrate_many_to_mother.sh | 4 +++- migrate_to_aunt.sh | 5 ++++- migrate_to_mother.sh | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/migrate_many_to_aunt.sh b/migrate_many_to_aunt.sh index 3a070a5..f0a6251 100755 --- a/migrate_many_to_aunt.sh +++ b/migrate_many_to_aunt.sh @@ -12,5 +12,8 @@ do echo MIGRATING $vm ... sudo virsh migrate --verbose --live --persistent --undefinesource --abort-on-error $vm qemu+ssh://192.169.254.3:223/system - sudo mv /var/backups/vm/mother/$vm /var/backups/vm/aunt + if [ $? != 0 ]; then + sudo mv /var/backups/vm/mother/$vm /var/backups/vm/aunt + fi + done diff --git a/migrate_many_to_mother.sh b/migrate_many_to_mother.sh index 768d6b8..cac72b3 100755 --- a/migrate_many_to_mother.sh +++ b/migrate_many_to_mother.sh @@ -12,5 +12,7 @@ do echo MIGRATING $vm ... sudo virsh migrate --verbose --live --persistent --undefinesource --abort-on-error $vm qemu+ssh://192.169.254.2:222/system - sudo mv /var/backups/vm/aunt/$vm /var/backups/vm/mother + if [ $? != 0 ]; then + sudo mv /var/backups/vm/aunt/$vm /var/backups/vm/mother + fi done diff --git a/migrate_to_aunt.sh b/migrate_to_aunt.sh index bee4647..fe27fff 100755 --- a/migrate_to_aunt.sh +++ b/migrate_to_aunt.sh @@ -10,4 +10,7 @@ fi echo MIGRATING $vm ... sudo virsh migrate --verbose --live --persistent --undefinesource --abort-on-error $vm qemu+ssh://192.169.254.3:223/system -sudo mv /var/backups/vm/mother/$vm /var/backups/vm/aunt +if [ $? != 0 ]; then + sudo mv /var/backups/vm/mother/$vm /var/backups/vm/aunt +fi + diff --git a/migrate_to_mother.sh b/migrate_to_mother.sh index 304b0e5..b704c8e 100755 --- a/migrate_to_mother.sh +++ b/migrate_to_mother.sh @@ -10,4 +10,6 @@ fi echo MIGRATING $vm ... sudo virsh migrate --verbose --live --persistent --undefinesource --abort-on-error $vm qemu+ssh://192.169.254.2:222/system -sudo mv /var/backups/vm/aunt/$vm /var/backups/vm/mother +if [ $? != 0 ]; then + sudo mv /var/backups/vm/aunt/$vm /var/backups/vm/mother +fi