2022-07-22 00:40:20 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
timestamp=$(date -u +%Y-%m-%dT%H:%m:%SZ)
|
|
|
|
rm -rf remote-backup
|
|
|
|
mkdir remote-backup
|
|
|
|
|
|
|
|
mkdir remote-backup/$timestamp
|
|
|
|
pg_dumpall -U postgres > remote-backup/$timestamp/all_databases.sql
|
|
|
|
cp -a /etc/synapse remote-backup/$timestamp/synapse
|
2022-08-07 08:01:42 -04:00
|
|
|
tar -c remote-backup/$timestamp | zstd -9 | age -r $(cat backup-public-key.txt) -o remote-backup/$timestamp.tar.zst.age
|
2022-07-22 00:40:20 -04:00
|
|
|
sshpass -f cloud-archive-password.txt rsync -v ./remote-backup/$timestamp.tar.zst.age pca@gateways.storage.gra.cloud.ovh.net:backup/
|