(re)create torrent file before upload

This commit is contained in:
Raphael Dannecker 2023-05-06 11:50:29 +02:00
parent b412535de3
commit fb1283a546

View file

@ -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/