Commit a9ebce32 authored by Michael Völske's avatar Michael Völske

backup-btrfs-vol: ensure snapshot is cleaned up

parent b34d7b92
......@@ -96,9 +96,10 @@ main() {
set -e
btrfs_snapshot "$FLAGS_volume" "$FLAGS_snapshot"
run_backup "$FLAGS_snapshot" $@
cleanup() { snapshot_delete "$FLAGS_snapshot"; }
trap cleanup EXIT
snapshot_delete "$FLAGS_snapshot"
run_backup "$FLAGS_snapshot" $@
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