From 9c51109d2ea14d0ecf8eebc438a823f792b6e9e5 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Fri, 23 Aug 2024 14:15:40 -0700 Subject: [PATCH] fix folder_snapshot to handle @ snapshots --- modules/filesystem/btrfs/btrfs.mod | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/filesystem/btrfs/btrfs.mod b/modules/filesystem/btrfs/btrfs.mod index 55989ca..ae0f67d 100644 --- a/modules/filesystem/btrfs/btrfs.mod +++ b/modules/filesystem/btrfs/btrfs.mod @@ -112,7 +112,11 @@ folder_snapshot() { if [[ -d $2/$sv ]]; then echo snapshot $sv already exists in $2. You must manually delete target snapshots! else - sudo $BTRFS_BIN sub snap $readonly $1/$sv $2 + if sudo mkdir -p "$2" > /dev/null; then + sudo $BTRFS_BIN sub snap $readonly "$1/$sv" "$2/$sv" + else + echo unable to make directory $2 so can not make subvolumes therein + fi fi done