2022-07-22 00:40:20 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
2022-08-11 18:17:24 -04:00
|
|
|
timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
2022-07-22 00:40:20 -04:00
|
|
|
rm -rf remote-backup
|
|
|
|
mkdir remote-backup
|
|
|
|
|
|
|
|
mkdir remote-backup/$timestamp
|
|
|
|
pg_dumpall -U postgres > remote-backup/$timestamp/all_databases.sql
|
2022-08-11 13:05:24 -04:00
|
|
|
cp -r /etc/synapse remote-backup/$timestamp/synapse
|
2022-08-07 08:10:45 -04:00
|
|
|
tar -cC 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/
|