2023-01-05 13:23:29 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
2023-01-05 13:38:35 +02:00
|
|
|
snap_path="$SANOID_TARGET/.zfs/snapshot/$SANOID_SNAPNAME"
|
2023-01-05 13:39:44 +02:00
|
|
|
[[ -d "$snap_path" ]] || { >&2 echo "expected directory $snap_path"; exit 1; }
|
2023-01-05 13:38:35 +02:00
|
|
|
link_path="$SANOID_TARGET/.snapshot-latest"
|
2023-01-05 13:23:29 +02:00
|
|
|
ln -sf "$snap_path" "$link_path"
|
|
|
|
>&2 printf "successfully created %s -> %s\n" "$link_path" "$snap_path"
|