Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider restic as a backend? #172

Open
prologic opened this issue Dec 28, 2022 · 7 comments
Open

Consider restic as a backend? #172

prologic opened this issue Dec 28, 2022 · 7 comments
Labels

Comments

@prologic
Copy link

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)? 馃

@m90
Copy link
Member

m90 commented Dec 28, 2022

This is kind of similar to #109 - is it possible to use restic as a Go library instead of using the provided binaries?

@prologic
Copy link
Author

Good question! If it isn't eight now, we could probably adopt it so that it can be?

@m90
Copy link
Member

m90 commented Dec 28, 2022

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).

@m90 m90 added the v3 label Dec 28, 2022
@prologic
Copy link
Author

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)?

@m90
Copy link
Member

m90 commented Dec 28, 2022

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-post label 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.

@m90
Copy link
Member

m90 commented Dec 30, 2022

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.

@prologic
Copy link
Author

Nice one! I'm going to give this a try! Thank you 馃檹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants