2022-07-22 00:40:20 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
remote=root@matrix.grapheneos.org
|
|
|
|
|
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
|
|
|
ssh $remote "rm -rf local-backup"
|
|
|
|
ssh $remote "mkdir local-backup"
|
|
|
|
|
|
|
|
ssh $remote "mkdir local-backup/$timestamp"
|
|
|
|
ssh $remote "pg_dumpall -U postgres > local-backup/$timestamp/all_databases.sql"
|
2022-08-11 13:05:24 -04:00
|
|
|
ssh $remote "cp -r /etc/synapse local-backup/$timestamp/synapse"
|
2022-08-07 08:01:42 -04:00
|
|
|
ssh $remote "tar -cC local-backup $timestamp | zstd -9 | age -r \$(cat backup-public-key.txt) -o local-backup/$timestamp.tar.zst.age"
|
2022-07-22 00:40:20 -04:00
|
|
|
rsync -v $remote:./local-backup/$timestamp.tar.zst.age backup/
|
2023-06-29 10:52:16 -04:00
|
|
|
|
|
|
|
ssh $remote "rm -rf local-backup"
|