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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mirroring and/or pushing a repository to multiple backends #1545
Comments
Hey, thanks for raising this issue. This function is something that I can see in restic, but not in the short term (we have more urgent issues/features to implement). For now, you need to stick to a third-party program/script around restic. What works great (as far as I've heard) is using restic to backup to a local repository, and then use I'll keep this issue open as a reminder. |
A related issue is #323 |
|
What happens if the local repository is changed (e.g. through backup or forget) while it is copied to another location? Can restic recover from that? |
In a restic repo, files are never modified, only deleted and replaced by files with different names. So in this case it'll be repaired automatically by the next rsync run. |
Another related issue is #265, which I believe can be closed as duplicate as we discuss this in the related issues #323, #391, #1545. One thought could be to either allow writing backups to multiple destinations at the same time (of the same backend type or different backends) or implement a copy/sync feature to replicate a snapshot over. For the latter case, I believe it could be important that we support the same set of backends that we support for regular backups. The distinction is whether you write it to different repositories (and possibly different backends) during the backup or after. |
I'm closing this issue as a duplicate of #265, thanks for the hint! |
@fd0 Sorry to reopen this discussion, but I'm trying to find out if I can simply mirror my restic repository to a second remote disk with rsync and if the above command is sufficient. If so, I think it would be a great idea to include this option in the documentation. (If there is an official way to do this, I would be willing to do that 😉 ). |
Yes, you can just copy all files/dirs to another location use that directly. The repository format is the same for every backend. I think it's a good idea to include this in the documentation. You can open a Pull Request, the docs are below |
👍 Thanks, you just got a new restic user. I'll see when I can find the time in the next few days for including this into the docs. |
This way of mirroring repositories doesn't seem right - if the main repo is corrupted, all the mirrors will be as well. Just keep that in mind :-) |
Does this apply to the |
At the moment,
restic
ties a repository to the backend which it is stored in. While this is okay if you assume that your backup provider will be around forever and will never lose your data, it is generally recommended to keep more than one backup with different services (to quote a common adage "If you don't have at least three copies of your data it doesn't exist.")At the moment I have two options for how to mirror my repositories:
Mirror them manually, outside of
restic
. This requires hooking up some other scripts around my existing backup workflow to be able to effectivelyrsync
the two mirrors. Obvious concerns with this scheme is how to correctly mirror deletions, and the fact that my backups are temporarily inconsistent before I complete thersync
.Create two separate repositories on both backends (with the same password so they can be accessed by the same script) and then just backup to each. This is obviously inefficient, as backing up a /very/ large repository takes a while and we would be doubling all of the backup overhead rather than just pushing the same blobs to two different stores. Not to mention that comparing the integrity of both stores is no longer really doable in a trivial way.
Would it be possible for
restic
to support pushing to multiple backends and then being able to round-robin when pulling from multiple backends? The idea would be you could specify something likerestic -r b2:some-bucket:my-backup1 -r /some/backup2 -r sftp:user@blah:some/backup3
. Thenrestic
would push blobs synchronously to all three backup stores when doing backups, and when doing a restore it will try to pull blobs in the given order (ifb2:some-bucket:my-backup1
fails, then it will fall-back to/some/backup2
in the above example).Is this something you'd be interested in, or do you feel this is outside of the scope of
restic
and I should just stick to cloning repositories with a higher-level script?The text was updated successfully, but these errors were encountered: