docker-restic-cron/scripts/restore.sh

27 lines
447 B
Bash
Raw Normal View History

2017-06-29 06:28:48 +00:00
#! /bin/bash
set -e
2021-06-14 22:55:26 +00:00
restore_snapshot="$1"
# Run pre-restore scripts
for f in /scripts/restore/before/*; do
2021-06-14 22:55:26 +00:00
if [ -f "$f" ] && [ -x "$f" ]; then
bash "$f"
fi
done
2021-06-14 22:55:26 +00:00
# shellcheck disable=SC2086
restic \
2021-06-14 22:55:26 +00:00
-r "$BACKUP_DEST" \
$OPT_ARGUMENTS \
restore \
2021-06-14 22:55:26 +00:00
"$restore_snapshot" \
-t /
# Run post-restore scripts
for f in /scripts/restore/after/*; do
2021-06-14 22:55:26 +00:00
if [ -f "$f" ] && [ -x "$f" ]; then
bash "$f"
fi
done