try to init restic

This commit is contained in:
jem 2020-12-20 13:55:17 +01:00
parent 765d62357b
commit 9c56d902c2

View file

@ -1,6 +1,6 @@
#!/bin/bash
set -o pipefail
set -Eeo pipefail
function main() {
@ -22,6 +22,9 @@ function main() {
psql -d template1 -h ${POSTGRES_SERVICE} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} \
--no-password -c "CREATE DATABASE \"${POSTGRES_DB}\";"
# init restic
restic -v -r ${RESTIC_REPOSITORY}/pg-role snapshots
# restore roles
restic -r ${RESTIC_REPOSITORY}/pg-role dump latest stdin | \
psql -d template1 -h ${POSTGRES_SERVICE} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} \