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
backup to multiple destinations at the same time #265
Comments
why in one run? why can't you just backup twice with different destinations? |
If the underlying data changes, you might not get exactly the same snapshots. |
That seems like an acceptable risk to me... Isn't worth the additional complexity this would add to the codebase, imho. But maybe I'm overestimating this. |
I've already thought about having something like a "sync" function that is able to copy data from one repo to another, maybe that's interesting... |
Would be neat to be able to cluster one backup across multiple targets with limited space, but often you want to spend as little time as possible uploading the backup from your primary machines (especially if that's a laptop or a production machine which needs to handle resource load). A capability/signature-aware replication daemon that could do append-only balancing, or "keep newest, purge unneeded objects" operations would be useful. I believe #256 about ECC could be relevant for the discussion of use cases for this feature. |
This feature request could be superseded by #323 |
As fd0 mentioned, it's essentially because I want just one backup in two different places; I want one snapshot, not two. Another reason though, is because I don't want to use all the CPU for two backups when just one will do. @fd0: If I may, I would like to take a stab at implementing this, if it won't be too difficult. I would need some guidance though. What do you think will be involved? As I think on this, I wonder if it is even possible to do reliably? Of course it is possible if the multiple destinations/backend repositories are in the exact same state, then it's very easy. But if for some reason one of the repositories is in a different state -- for example, network was down, so only the local destination was backed up to last time -- then I wonder if it is possible to make backing up to the two destinations "at the same time" even worth it. Does that make sense? Restic would be comparing two different sets of diffs, and performing essentially dual backup operations, and combining them into a single invocation just sounds complicated. What do you think? But if it's possible to get the repositories to be identical before beginning the "hard" or "expensive" part of the backup, maybe then it would be worth it? Can I get your thoughts on this? |
I'd like to investigate first if this can be achieved with just rclone. Make a backup to one backend (e.g. local), then synchronize the changes to all the others. Then you'll end up with identical snapshots and data. When you sync file deletions, too, then you can run It's a two-step process, but it'll keep restic much simpler, and I can't see any downsides... |
@fd0 I'd fully support that. I've been thinking about this more and I agree, I don't see why restic should try to do this. If the repos are at all different, they will be effectively two different backups anyway. As long as I am already doing this manually when I run automated backups to a local destination then sync to the cloud (minus the proxying, but I will need that for my family members!) -- so I know it works. One good question to consider is whether the sync should happen just BEFORE or just AFTER a backup takes place. If rclone can proxy to another instance of itself and if we're OK with the two-step process, then I'm OK with closing this issue. 👍 Edit: If this goes the |
Hm. I'm not sure we're talking about the same thing here. My suggestion was:
When
Then you'll end up with three copies of the repo, one on your server, one on S3, and one on B2. If you'd like people to be able to access the cloud repositories, give them a way to access an rclone process started with the right remote, like I'm not sure what you mean with Maybe it's helpful to discuss the concrete situation that you'd like to solve in the forum or so. |
Sure -- I will post in the forum, although, since this is about rclone, I've posted it in the rclone forum: https://forum.rclone.org/t/proxying-through-a-remote-rclone-instance/5318/1 Basically, my scenario is your first suggestion:
Except that using rclone locally to sync directly to S3 and B2 requires rclone to have credentials, which in this case the computer doing the backup cannot have access to the credentials. Hence I need a way to rclone to another remote rclone that does have the credentials. Your second suggestion almost does what I need, except that it involves the server storing the backup on it before it copies to B2 and S3. While that might be desirable for some, I'm trying to avoid an intermediate storage place. Thanks again! Hope that clarifies some insight into my use case. |
Hey all, so I would also very much like the feature of having multiple repositories for one run. The reasons being:
I will totally try to create a PR, but I wanted to make sure it wasn't moot work, so I would like to hear your opinion first @fd0 and others. cheers :) |
Closing this as the new @mholt If this is still relevant, for your use case |
Is there any recent docker image with cron to trigger a scheduled copy as suggested ? |
In order to prevent backup corruption due to a faulty destination, restic could get the feature to backup to two destinations in one run.
The text was updated successfully, but these errors were encountered: