feat: add archive listing and resolution to restore.sh

This commit is contained in:
kbe
2026-07-25 18:57:21 +02:00
parent 49ed87b46b
commit 769eeea2b9
3 changed files with 105 additions and 0 deletions
+13
View File
@@ -52,6 +52,19 @@ run_cmd() {
"$@"
}
resolve_archive() {
if [[ -n "$ARCHIVE_OVERRIDE" ]]; then
RESOLVED_ARCHIVE="$ARCHIVE_OVERRIDE"
return 0
fi
RESOLVED_ARCHIVE="$(borg list --short --lock-wait 60 2>/dev/null | tail -n1)"
[[ -n "$RESOLVED_ARCHIVE" ]] || die "no archives found in repo $REPO"
}
list_archives() {
borg list --lock-wait 60
}
usage() {
cat <<'EOF'
Usage: