container-server/setup/backup
2024-10-29 19:26:50 +01:00
..
cleanup-backup.sh docs: Update some outdated docs, move backup config into setup 2024-10-29 19:26:50 +01:00
config.template.yaml docs: Update some outdated docs, move backup config into setup 2024-10-29 19:26:50 +01:00
prepare-backup.sh docs: Update some outdated docs, move backup config into setup 2024-10-29 19:26:50 +01:00
README.md docs: Update some outdated docs, move backup config into setup 2024-10-29 19:26:50 +01:00

Backup

Backing up the BASE_DIR (default: /srv) should in theory be sufficient.

Database Backup

As database servers like PostgreSQL might not play nicely with taking a backup of their data folders while running, it's advised to first dump the database and only include the dump in the backup.

Therefore, all database containers SHOULD follow a common naming folder scheme.

postgres

Scheme: $BASE_DIR/{service}/psql

Task: task srv:psql-dump -- {service}

Dump: /tmp/container-server/{service}.sql

{to be extended}

Scheme: $BASE_DIR/{service}/tbd

Task: task srv:tbd-dump -- {service}

Dump: /tmp/container-server/{service}.tbd

Borgmatic

https://torsion.org/borgmatic/

Create a repo on your backup server, e.g. https://www.borgbase.com

Install

apk add borgmatic

Config

See config file for excluded dirs

ln -vs /opt/container-server/setup/backup/config.yaml /etc/borgmatic/config.yaml