2022-07-22 04:40:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
2022-08-11 22:17:24 +00:00
|
|
|
timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
2022-07-22 04:40:20 +00:00
|
|
|
rm -rf remote-backup
|
|
|
|
mkdir remote-backup
|
|
|
|
|
|
|
|
mkdir remote-backup/$timestamp
|
|
|
|
pg_dumpall -U postgres > remote-backup/$timestamp/all_databases.sql
|
2023-12-07 13:41:08 +00:00
|
|
|
cp -r /etc/matterbridge.toml remote-backup/$timestamp/matterbridge.toml
|
2022-08-11 17:05:24 +00:00
|
|
|
cp -r /etc/synapse remote-backup/$timestamp/synapse
|
2023-11-04 19:12:45 +00:00
|
|
|
cp -r /var/lib/mjolnir remote-backup/$timestamp/mjolnir
|
2022-08-07 12:10:45 +00: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 04:40:20 +00:00
|
|
|
sshpass -f cloud-archive-password.txt rsync -v ./remote-backup/$timestamp.tar.zst.age pca@gateways.storage.gra.cloud.ovh.net:backup/
|
2023-06-29 14:52:16 +00:00
|
|
|
|
|
|
|
rm -rf remote-backup
|