docker-restic-cron/scripts/restore.sh
2021-06-14 17:01:52 -07:00

27 lines
447 B
Bash
Executable File

#! /bin/bash
set -e
restore_snapshot="$1"
# Run pre-restore scripts
for f in /scripts/restore/before/*; do
if [ -f "$f" ] && [ -x "$f" ]; then
bash "$f"
fi
done
# shellcheck disable=SC2086
restic \
-r "$BACKUP_DEST" \
$OPT_ARGUMENTS \
restore \
"$restore_snapshot" \
-t /
# Run post-restore scripts
for f in /scripts/restore/after/*; do
if [ -f "$f" ] && [ -x "$f" ]; then
bash "$f"
fi
done