matrix.grapheneos.org/remote-backup

21 lines
758 B
Plaintext
Raw Normal View History

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
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
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
rm -rf remote-backup