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
|
2023-12-07 08:41:08 -05:00
|
|
|
cp -r /etc/matterbridge.toml remote-backup/$timestamp/matterbridge.toml
|
2022-08-11 13:05:24 -04:00
|
|
|
cp -r /etc/synapse remote-backup/$timestamp/synapse
|
2023-11-04 15:12:45 -04:00
|
|
|
cp -r /var/lib/mjolnir remote-backup/$timestamp/mjolnir
|
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/
|
2023-06-29 10:52:16 -04:00
|
|
|
|
|
|
|
rm -rf remote-backup
|