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