docker-restic-cron/restore.sh

26 lines
393 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 -a -x $f ]; then
bash $f
fi
done
restic \
-r $BACKUP_DEST \
$OPT_ARGUMENTS \
restore \
$restore_snapshot \
-t /
# Run post-restore scripts
for f in /scripts/restore/after/*; do
if [ -f $f -a -x $f ]; then
bash $f
fi
done