rustic
rustic copied to clipboard
bidirectional sync ?
hey do you think it would be possible to add bidirectional synchronization ? rclone can do it but it would be neat to have all the advantages of restic at the same time.
Can you shortly describe what you expect of this possible feature? How do you as a user imagine it to work? What are you going to achieve with it?
Hey simonsan, thanks for the prompt reply ! so the idea would be a feature similar to rclone's bisync, the idea is that if you have local and remote, you push all files that are in local but not in remote to remote, but at the same time you pull all files that are in remote but not in local. if on top you can keep track of deletions events that would be neat, meaning if a file got deleted in remote, it'll also delete it from local.
that's generally how most cloud services like google drive or mega work, except for the fact that you would have all of rustic's advantages like using s3. and at the difference that it isn't syncing constantly and in realtime but only when the command is run.
realtime syncing would be amazing and i wish i had something like rustic that'd do realtime syncing but that now seems really out of scope.
have a good day !
Actually syncing is not the main objective for rustic - there are tools like syncthing out there which may suit to your needs much better!
If you want something like syncing without deletion, you can do the following:
- run backup on computer A -> gives snapshot a0
- run backup on computer B -> gives snapshot b0
- obtain a merged snapshot using
rustic merge a0 b0-> gives snapshot m0
Then, to actually do the syncing, run:
- backup on computer A -> gives snapshot a1
- merge the backup into the merged snapshot:
rustic merge m0 a1-> gives snapshot m1 - directly restore snapshot m1 on computer A (this in fact just restores the additional files on m1)
And the same on the other computer:
- backup on computer B -> gives snapshot b1
- merge the backup into the merged snapshot:
rustic merge m1 b1-> gives snapshot m2 - directly restore snapshot m2 on computer B (this in fact just restores the additional files on m2)
.. and so on...
The snapshots a0, a1, b0, b1, m0, m1,m2 need to be replaced with the actual snapshot IDs, of course, so this may need a bit of scripting.