mirror of
https://github.com/GrapheneOS/matrix.grapheneos.org.git
synced 2024-12-30 09:56:20 -05:00
14 lines
540 B
Bash
Executable File
14 lines
540 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
rm -rf remote-backup
|
|
mkdir remote-backup
|
|
|
|
mkdir remote-backup/$timestamp
|
|
pg_dumpall -U postgres > remote-backup/$timestamp/all_databases.sql
|
|
cp -r /etc/synapse remote-backup/$timestamp/synapse
|
|
tar -cC remote-backup $timestamp | zstd -9 | age -r $(cat backup-public-key.txt) -o remote-backup/$timestamp.tar.zst.age
|
|
sshpass -f cloud-archive-password.txt rsync -v ./remote-backup/$timestamp.tar.zst.age pca@gateways.storage.gra.cloud.ovh.net:backup/
|