This commit is contained in:
albert 2024-12-16 01:57:56 +01:00
parent 6ab45ff490
commit 799c417f90
Signed by: albert
GPG key ID: 3895DD267CA11BA9

View file

@ -12,14 +12,15 @@ fi
SNAPPER_CONFIG="$1"
# Get the actual snapshot location from snapper config
SOURCE_PATH=$(sudo snapper -c "$SNAPPER_CONFIG" get-config | grep '^SUBVOLUME' | cut -d'=' -f2 | tr -d '"'| awk {'print $3'})
SOURCE_PATH=$(sudo snapper -c "$SNAPPER_CONFIG" get-config | grep '^SUBVOLUME' | cut -d'=' -f2 | tr -d '"'| awk {'print $3'})
echo "SOURCE_PATH: $SOUCE_PATH"
if [ -z "$SOURCE_PATH" ]; then
echo "ERROR: Could not determine snapshot path for config '$SNAPPER_CONFIG'"
exit 1
fi
# Convert subvolume path to snapshot path
SNAPSHOT_PATH="$SOURCE_PATH/.snapshots"
SNAPSHOT_PATH="$SOURCE_PATH.snapshots"
if [ ! -d "$SNAPSHOT_PATH" ]; then
echo "ERROR: Snapshot directory '$SNAPSHOT_PATH' does not exist"
exit 1