Compare commits
5 Commits
93b7e19556
...
c107e73ddf
Author | SHA1 | Date |
---|---|---|
Marco von Rosenberg | c107e73ddf | 2 years ago |
Marco von Rosenberg | 0d32747552 | 2 years ago |
Marco von Rosenberg | e4c4410ba3 | 2 years ago |
Marco von Rosenberg | f1c199ca10 | 2 years ago |
Marco von Rosenberg | 16c8bc79a1 | 2 years ago |
@ -0,0 +1,21 @@ |
||||
# Immediatly exit on command failure (e) |
||||
# and quit on unset variables (u) |
||||
set -ue |
||||
|
||||
export BACKUP_REPO=ssh://cttuebak/media/borg/cttue/gitea |
||||
export BACKUP_NAME_DB="db_$(date -u +'%Y-%m-%dT%H:%M%Z')" |
||||
export BACKUP_NAME_DATA="data_$(date -u +'%Y-%m-%dT%H:%M%Z')" |
||||
export BORG_PASSPHRASE=$(cat "$(dirname $0)/borg_passphrase.txt") |
||||
|
||||
# Dump the database into borg create |
||||
echo "Starting Backup of Gitea Database..." |
||||
docker exec gitea_db_1 pg_dump gitea -U gitea | |
||||
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DB} - |
||||
|
||||
echo "Starting Backup of Gitea Data..." |
||||
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /srv/docker-containers/gitea/gitea-data |
||||
|
||||
echo "Backup done. Pruning backup-repo..." |
||||
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO} |
||||
|
||||
echo "Done" |
@ -0,0 +1,21 @@ |
||||
# Immediatly exit on command failure (e) |
||||
# and quit on unset variables (u) |
||||
set -ue |
||||
|
||||
export BACKUP_REPO=ssh://cttuebak/media/borg/cttue/matrix |
||||
export BACKUP_NAME_DB="db_$(date -u +'%Y-%m-%dT%H:%M%Z')" |
||||
export BACKUP_NAME_DATA="synapse-storage_$(date -u +'%Y-%m-%dT%H:%M%Z')" |
||||
export BORG_PASSPHRASE=$(cat "$(dirname $0)/borg_passphrase.txt") |
||||
|
||||
# Dump the database into borg create |
||||
echo "Starting Backup of Matrix / Synapse Database..." |
||||
docker exec matrix-postgres pg_dump synapse -U synapse | |
||||
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DB} - |
||||
|
||||
echo "Starting Backup of Matrix / Synapse Storage..." |
||||
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /matrix/synapse/storage |
||||
|
||||
echo "Backup done. Pruning backup-repo..." |
||||
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO} |
||||
|
||||
echo "Done" |
@ -0,0 +1,15 @@ |
||||
# Immediatly exit on command failure (e) |
||||
# and quit on unset variables (u) |
||||
set -ue |
||||
|
||||
export BACKUP_REPO=ssh://cttuebak/media/borg/cttue/nginx-proxy |
||||
export BACKUP_NAME_DATA="data_$(date -u +'%Y-%m-%dT%H:%M%Z')" |
||||
export BORG_PASSPHRASE=$(cat "$(dirname $0)/borg_passphrase.txt") |
||||
|
||||
echo "Starting Backup of nginx-proxy data..." |
||||
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /srv/docker-containers/nginx-proxy/nginx-data |
||||
|
||||
echo "Backup done. Pruning backup-repo..." |
||||
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO} |
||||
|
||||
echo "Done" |
Loading…
Reference in new issue