try to init restic
This commit is contained in:
parent
765d62357b
commit
9c56d902c2
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -o pipefail
|
set -Eeo pipefail
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
|
||||||
|
@ -22,6 +22,9 @@ function main() {
|
||||||
psql -d template1 -h ${POSTGRES_SERVICE} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} \
|
psql -d template1 -h ${POSTGRES_SERVICE} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} \
|
||||||
--no-password -c "CREATE DATABASE \"${POSTGRES_DB}\";"
|
--no-password -c "CREATE DATABASE \"${POSTGRES_DB}\";"
|
||||||
|
|
||||||
|
# init restic
|
||||||
|
restic -v -r ${RESTIC_REPOSITORY}/pg-role snapshots
|
||||||
|
|
||||||
# restore roles
|
# restore roles
|
||||||
restic -r ${RESTIC_REPOSITORY}/pg-role dump latest stdin | \
|
restic -r ${RESTIC_REPOSITORY}/pg-role dump latest stdin | \
|
||||||
psql -d template1 -h ${POSTGRES_SERVICE} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} \
|
psql -d template1 -h ${POSTGRES_SERVICE} -p ${POSTGRES_PORT} -U ${POSTGRES_USER} \
|
||||||
|
|
Loading…
Reference in a new issue