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
|
2024-05-24 12:43:16 -04:00
|
|
|
|
|
|
|
source cloud-archive.sh
|
2024-05-28 15:38:38 -04:00
|
|
|
swift upload --skip-container-put --segment-size 5368709122 -H "X-Delete-After: 5184000" \
|
|
|
|
--object-name $timestamp.tar.zst.age backup remote-backup/$timestamp.tar.zst.age
|
2023-06-29 10:52:16 -04:00
|
|
|
|
|
|
|
rm -rf remote-backup
|