diff options
author | Till Höppner | 2017-05-31 18:00:15 +0200 |
---|---|---|
committer | Till Höppner | 2017-05-31 18:00:15 +0200 |
commit | 33c2361ab6f0d7bfc802d2fc10d2f29aef44867b (patch) | |
tree | 706f4c46e942433eb13cba20cedd816bb07226ae /images/backup/duplicity/restore.sh | |
parent | c20a9f58eb362ad84a1f0e3b911b89ffc9bf8451 (diff) | |
download | server-33c2361ab6f0d7bfc802d2fc10d2f29aef44867b.tar.gz server-33c2361ab6f0d7bfc802d2fc10d2f29aef44867b.tar.xz server-33c2361ab6f0d7bfc802d2fc10d2f29aef44867b.zip |
Add backup image
Diffstat (limited to 'images/backup/duplicity/restore.sh')
-rwxr-xr-x | images/backup/duplicity/restore.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/images/backup/duplicity/restore.sh b/images/backup/duplicity/restore.sh new file mode 100755 index 0000000..df3f9c9 --- /dev/null +++ b/images/backup/duplicity/restore.sh @@ -0,0 +1,26 @@ +#!/bin/sh -xe +set -x +set -e + +CONNECTION_OPTIONS="--use-agent \ + --verbosity $LOG_LEVEL \ + --num-retries 3 \ + --encrypt-key $FINGERPRINT \ + --log-file /dev/stdout \ + --archive-dir /cache/archive \ + --ssh-options=-oIdentityFile=/ssh_keys/backup \ + --gpg-options --passphrase=$PASSPHRASE \ + --gpg-options --no-tty \ + --gpg-options --batch \ + --gpg-options --pinentry-mode=loopback" + +# Import and trust the GPG Keys +gpg --passphrase $PASSPHRASE --no-tty --batch --import /gpg_keys/*.priv.asc +echo "$FINGERPRINT:6:" | gpg --import-ownertrust + +mkdir -p /cache/archive + +# Restore the Backup +duplicity restore \ + $CONNECTION_OPTIONS \ + "$BACKUP_STORAGE" /data/ |