diff --git a/infrastrucure/docker/image/resources/restore.sh b/infrastrucure/docker/image/resources/restore.sh index 511320a..7425aff 100755 --- a/infrastrucure/docker/image/resources/restore.sh +++ b/infrastrucure/docker/image/resources/restore.sh @@ -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} \