mirror of
https://github.com/ViViDboarder/docker-restic-cron.git
synced 2024-11-23 13:46:35 +00:00
27 lines
447 B
Bash
Executable File
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
|