From fb1283a54656902ba63bc0ff32eb22f1f593e47f Mon Sep 17 00:00:00 2001 From: Raphael Dannecker Date: Sat, 6 May 2023 11:50:29 +0200 Subject: [PATCH] (re)create torrent file before upload --- roles/lmn_vm/files/sync-vm.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/lmn_vm/files/sync-vm.sh b/roles/lmn_vm/files/sync-vm.sh index 471ee69..0b74b38 100755 --- a/roles/lmn_vm/files/sync-vm.sh +++ b/roles/lmn_vm/files/sync-vm.sh @@ -38,7 +38,10 @@ upload_image() { echo "copy private VM-Maschine-Definition XML to system-dir" cp "${VM_DIR}/${VM_NAME}.xml" "/var/lib/libvirt/images/${VM_NAME}.xml" fi - [[ -f "/var/lib/libvirt/images/${VMNAME}.qcow2.torrent" ]] && rsync -av --password-file=/etc/rsync.secret \ + # (re-) create torrent file + /usr/local/bin/vmimage-torrent create "${VM_NAME}.qcow2" + # Upload Torrent, qcow2 and machine-definition-XML + [[ -f "/var/lib/libvirt/images/${VM_NAME}.qcow2.torrent" ]] && rsync -av --password-file=/etc/rsync.secret \ "/var/lib/libvirt/images/${VM_NAME}.qcow2" rsync://vmuser@server:/vmimages-upload/ rsync -av --password-file=/etc/rsync.secret "/var/lib/libvirt/images/${VM_NAME}.qcow2" \ rsync://vmuser@server:/vmimages-upload/