.. | ||
cleanup-backup.sh | ||
config.template.yaml | ||
prepare-backup.sh | ||
README.md |
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