2017-06-29 06:28:48 +00:00
|
|
|
#! /bin/bash
|
|
|
|
set -e
|
|
|
|
|
2018-07-24 15:38:22 +00:00
|
|
|
restore_snapshot=$1
|
2018-05-13 17:30:02 +00:00
|
|
|
|
2019-01-28 19:44:38 +00:00
|
|
|
# Run pre-restore scripts
|
|
|
|
for f in /scripts/restore/before/*; do
|
|
|
|
if [ -f $f -a -x $f ]; then
|
|
|
|
bash $f
|
|
|
|
fi
|
|
|
|
done
|
2018-09-28 00:32:55 +00:00
|
|
|
|
2018-07-24 15:38:22 +00:00
|
|
|
restic \
|
|
|
|
-r $BACKUP_DEST \
|
|
|
|
$OPT_ARGUMENTS \
|
|
|
|
restore \
|
|
|
|
$restore_snapshot \
|
|
|
|
-t /
|
2018-09-28 00:32:55 +00:00
|
|
|
|
2019-01-28 19:44:38 +00:00
|
|
|
# Run post-restore scripts
|
|
|
|
for f in /scripts/restore/after/*; do
|
|
|
|
if [ -f $f -a -x $f ]; then
|
|
|
|
bash $f
|
|
|
|
fi
|
|
|
|
done
|