spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.91k stars 1.04k forks source link

Borg-Backup to local directory/repository #2238

Open cxr6548 opened 2 years ago

cxr6548 commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I'd like to be able to specify a local directory for backups rather than only a remote location. I attempted already and got the error:

failed: [matrix.redacted.com] (item=matrix_backup_borg_ssh_key_private) => changed=false 
  ansible_loop_var: item
  item: matrix_backup_borg_ssh_key_private
  msg: You need to define a required configuration setting (`matrix_backup_borg_ssh_key_private`).
skipping: [matrix.redacted.com] => (item=matrix_backup_borg_location_repositories)

Describe the solution you'd like I'd like to be able to back up to local directories.

Describe alternatives you've considered Currently I stop the server/playbook and make a TAR file of /matrix as my backup scheme. Then I restart the server and can upload the TAR elsewhere while the server is running.

My ideal backup strategy would be to do something similar but with duplicity.

Additional context This playbook is amazing :)

cxr6548 commented 2 years ago

In the past couple days I've come up with a system that works well for me. I enabled docker-postgres-backup-local so that I have a coherent point in time to back up. Once daily duplicity --exclude /matrix/postgres (installed by the root system package manager) makes a backup to a different hard drive.

Also once per day s3cmd sync uploads the duplicity archive to an s3 bucket. I'll probably configure that bucket to be append-only in the future so that it's resistant to ransomware or some other nastiness.