docker-volume-backup
docker-volume-backup copied to clipboard
Consider restic as a backend?
Have you considered using restic as a backend directly for storage/backup so this tool can focus on the parts that matter (docker volumes, stopping/restarting containers, etc)? 🤔
This is kind of similar to #109 - is it possible to use restic as a Go library instead of using the provided binaries?
Good question! If it isn't eight now, we could probably adopt it so that it can be?
The trouble is, if this tool would consume a blob of Go code that is not meant to be used as a library, we don't get any stability guarantees for the API interface, which I'd consider a deal breaker.
If restic is meant to be used as a library as well, I would be open to thinking about this for whenever V3 is happening (which is not going to be very soon).
Judging by the open issues and codebase of restic, I don't see an easy way to use it as a library and it looks like it might not happen. Hmmm 🤔 -- What about abstracting the code here in this project such that one could easily (if they wanted to) integrate the use of restic via fork/exec'ing out to a tool to satisfy the interface (TBD)?
Theoretically, you could already "bring your own backend" by doing the following:
- create a Docker image off this one, copying in the restic binary
- configure the backup schedule without defining any values for a storage
- define your restic command in the
docker-volume-backup.process-postlabel for the backup container itself
This should basically give you what you want. The only ugly part here would probably be that you have to figure out the filename of the archive yourself somehow.
Maybe it would be nice to make such values (file locations and such) available in the environment so scripts like this could consume them.
Maybe it would be nice to make such values (file locations and such) available in the environment so scripts like this could consume them.
I added this in v2.24.0. You can check the docs here: https://github.com/offen/docker-volume-backup#handle-file-uploads-using-third-party-tools and the respective test case: https://github.com/offen/docker-volume-backup/tree/main/test/extend for an idea of how this works.
Nice one! I'm going to give this a try! Thank you 🙏