Mount backup directory + export PGPASSWORD

This commit is contained in:
Quentin 2021-03-06 20:06:57 +01:00
parent d1a4ed0f79
commit c0d86cb0a1
2 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,7 @@ EOF
echo "export sql" echo "export sql"
# note, -Fc means that postgresql compresses the output # note, -Fc means that postgresql compresses the output
PGPASSWORD=$MATRIX_PSQL_PWD export PGPASSWORD=$MATRIX_PSQL_PWD
pg_dump -v -Fc -U $MATRIX_PSQL_USER -h psql-proxy.service.2.cluster.deuxfleurs.fr $MATRIX_PSQL_DB | \ pg_dump -v -Fc -U $MATRIX_PSQL_USER -h psql-proxy.service.2.cluster.deuxfleurs.fr $MATRIX_PSQL_DB | \
age -r "$(cat /root/.ssh/id_ed25519.pub)" | \ age -r "$(cat /root/.ssh/id_ed25519.pub)" | \
ssh backuphost "cat > $TARGET_SSH_DIR/matrix/db-$(date --iso-8601=minute).gz.age" ssh backuphost "cat > $TARGET_SSH_DIR/matrix/db-$(date --iso-8601=minute).gz.age"

View file

@ -11,7 +11,8 @@ job "backup_manual" {
volumes = [ volumes = [
"secrets/id_ed25519:/root/.ssh/id_ed25519", "secrets/id_ed25519:/root/.ssh/id_ed25519",
"secrets/id_ed25519.pub:/root/.ssh/id_ed25519.pub", "secrets/id_ed25519.pub:/root/.ssh/id_ed25519.pub",
"secrets/known_hosts:/root/.ssh/known_hosts" "secrets/known_hosts:/root/.ssh/known_hosts",
"/mnt/glusterfs/chat/matrix/synapse/media:/mnt/glusterfs/chat/matrix/synapse/media"
] ]
network_mode = "host" network_mode = "host"
} }