diff --git a/btrfs-snapshots.sh b/btrfs-snapshots.sh index f15dd2e..d0c7508 100755 --- a/btrfs-snapshots.sh +++ b/btrfs-snapshots.sh @@ -158,7 +158,11 @@ if [[ -z "$1" ]]; then exit 0 else if is_subvolume "$1"; then - SNAP_FOLDER="${1%/}/$SNAP_FOLDER" + if [[ "$1" == "/" ]]; then + SNAP_FOLDER="/$SNAP_FOLDER" + else + SNAP_FOLDER="${1%/}/$SNAP_FOLDER" + fi # Create $SNAP_FOLDER if it does not exist if [[ ! -d "$SNAP_FOLDER" ]]; then lib_print "?Creating snapshot folder because it does not yet exist [$SNAP_FOLDER]"