From 38be6c13f76e893cf47636257071b440dec0c5b2 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Sun, 7 Sep 2025 17:32:13 +0200 Subject: initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- bundles/restic-backup/files/resticrestore | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 bundles/restic-backup/files/resticrestore (limited to 'bundles/restic-backup/files/resticrestore') diff --git a/bundles/restic-backup/files/resticrestore b/bundles/restic-backup/files/resticrestore new file mode 100644 index 0000000..68a10f1 --- /dev/null +++ b/bundles/restic-backup/files/resticrestore @@ -0,0 +1,29 @@ +#!/bin/sh +set -eu + +backup_tag=foobar +backup_restore_snapshot=latest + +main() { + # remove stale locks + resticw unlock + + # run restore + resticw restore \ + --verify \ + --tag "${backup_tag}" \ + --include "${1:-*}" \ + --target / \ + "${backup_restore_snapshot}" + + # TODO: restic check + # TODO: dump stats to file in metrics format to /run/prom/restic +} + +exit_hook() { + resticw unlock +} +trap exit_hook INT EXIT + +[ "$1" = "-h" ] && printf 'usage: resticrestore [TARGET]\n\n' && exit 0 +main "$1" -- cgit 1.4.1