remove old qcows if filesize on server has changed
This commit is contained in:
parent
022e8ff19b
commit
3768d0e77b
2 changed files with 22 additions and 0 deletions
|
@ -42,9 +42,14 @@ upload_image() {
|
|||
cd /lmn/vm
|
||||
# (re-) create torrent file
|
||||
sudo -u lmnsynci /usr/local/bin/vmimage-torrent create "${VM_NAME}.qcow2"
|
||||
# create size-information-file
|
||||
stat -c%s "${VM_NAME}.qcow2" > "${VM_NAME}.qcow2.size"
|
||||
chown lmnsynci:lmnsynci "${VM_NAME}.qcow2.size"
|
||||
# Upload Torrent, qcow2 and machine-definition-XML
|
||||
[[ -f "/lmn/vm/${VM_NAME}.qcow2.torrent" ]] && rsync -av --password-file=/etc/rsync.secret \
|
||||
"/lmn/vm/${VM_NAME}.qcow2.torrent" rsync://vmuser@server:/vmimages-upload/
|
||||
rsync -av --password-file=/etc/rsync.secret "/lmn/vm/${VM_NAME}.qcow2.size" \
|
||||
rsync://vmuser@server:/vmimages-upload/
|
||||
rsync -av --password-file=/etc/rsync.secret "/lmn/vm/${VM_NAME}.qcow2" \
|
||||
rsync://vmuser@server:/vmimages-upload/
|
||||
rsync -av --password-file=/etc/rsync.secret "/lmn/vm/${VM_NAME}.xml" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue