Don't exit VM backup scripts immediately on failures

This commit is contained in:
Râu Cao 2023-11-15 13:20:42 +01:00
parent 390753faa3
commit aaae90bc0d
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
2 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,6 @@
#!/bin/bash
# GENERATED BY CHEF
# DO NOT EDIT
set -e
REPOSITORY=$BORG_REPO
@ -18,6 +17,7 @@ virsh snapshot-create-as --domain $1 \
--disk-only \
--diskspec vda,snapshot=external
# TODO report failures
borg create -v $REPOSITORY::$1_$(date +%F_%H-%M) \
/var/lib/libvirt/images/$1.qcow2 \
/root/backups/vm_meta/$1.xml

View File

@ -1,14 +1,12 @@
#!/bin/bash
# GENERATED BY CHEF
# DO NOT EDIT
set -e
echo "Backing up all VMs with kvm_guest chef role..."
for domain in <%= @vm_domains.join(" ") %>
do
/root/backups/backup_vm.sh $domain
/root/backups/prune_vm_backups.sh $domain
/root/backups/backup_vm.sh $domain && /root/backups/prune_vm_backups.sh $domain
# TODO Enable this when upgrading borg to 1.2
# borg compact $BORG_REPO
done