Verified Commit 245c99fb authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

roles/borg-client: Fix backup script behavior for non-btrfs systems

parent 053341eb
......@@ -38,6 +38,8 @@ if is_btrfs "$src"; then
btrfs subvolume snapshot -r "$vol" "$vol/$snapshotdir"
mount -o bind "$vol/$snapshotdir" "$backup_mountdir/$vol"
done
else
backup_mountdir="$src"
fi
systemctl is-active postgresql && /usr/local/bin/backup-postgres.sh || true
......@@ -61,10 +63,12 @@ borg create -v --stats -C lz4 \
{{ backup_host }}:{{ backup_dir }}::$(date "+%Y%m%d-%H%M%S") "$backup_mountdir"
borg prune -v {{ backup_host }}:{{ backup_dir }} --keep-daily=7 --keep-weekly=4 --keep-monthly=6
umount -R "$backup_mountdir"
for vol in $list_of_btrfs_submounts; do
delete_snapshot "$vol/$snapshotdir"
done
rmdir "$backup_mountdir"
if is_btrfs "$src"; then
umount -R "$backup_mountdir"
for vol in $list_of_btrfs_submounts; do
delete_snapshot "$vol/$snapshotdir"
done
rmdir "$backup_mountdir"
fi
/usr/bin/vendor_perl/borg-restore.pl --update-cache
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment