From cc6b45c5a93ff9b8397b711317181e37d4795a3a Mon Sep 17 00:00:00 2001 From: admin666 Date: Fri, 5 Aug 2022 15:03:27 +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 | 2 +- migrate_many_to_mother.sh | 2 +- migrate_to_aunt.sh | 2 +- migrate_to_mother.sh | 2 +- migrate_to_mother_p2p.sh | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/migrate_many_to_aunt.sh b/migrate_many_to_aunt.sh index f0a6251..03d8e36 100755 --- a/migrate_many_to_aunt.sh +++ b/migrate_many_to_aunt.sh @@ -12,7 +12,7 @@ do echo MIGRATING $vm ... sudo virsh migrate --verbose --live --persistent --undefinesource --abort-on-error $vm qemu+ssh://192.169.254.3:223/system - if [ $? != 0 ]; then + if [ $? == 0 ]; then sudo mv /var/backups/vm/mother/$vm /var/backups/vm/aunt fi diff --git a/migrate_many_to_mother.sh b/migrate_many_to_mother.sh index cac72b3..eb30e26 100755 --- a/migrate_many_to_mother.sh +++ b/migrate_many_to_mother.sh @@ -12,7 +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 - if [ $? != 0 ]; then + 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 fe27fff..a9a701a 100755 --- a/migrate_to_aunt.sh +++ b/migrate_to_aunt.sh @@ -10,7 +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 -if [ $? != 0 ]; then +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 b704c8e..541ab0f 100755 --- a/migrate_to_mother.sh +++ b/migrate_to_mother.sh @@ -10,6 +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 -if [ $? != 0 ]; then +if [ $? == 0 ]; then sudo mv /var/backups/vm/aunt/$vm /var/backups/vm/mother fi diff --git a/migrate_to_mother_p2p.sh b/migrate_to_mother_p2p.sh index ec4ad9c..3f00782 100755 --- a/migrate_to_mother_p2p.sh +++ b/migrate_to_mother_p2p.sh @@ -4,4 +4,6 @@ vm=$1 echo MIGRATING $vm ... virsh migrate --p2p $vm --live --verbose --undefinesource --persistent --copy-storage-all --abort-on-error qemu+ssh://mother.onlink/system -sudo mv /var/backups/vm/aunt/* /var/backups/vm/mother +if [ $? == 0]; then + sudo mv /var/backups/vm/aunt/* /var/backups/vm/mother +fi