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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two-way (bidirectional) synchronization #118

Closed
alexander-yakushev opened this issue Sep 1, 2015 · 88 comments · Fixed by #5164
Closed

Two-way (bidirectional) synchronization #118

alexander-yakushev opened this issue Sep 1, 2015 · 88 comments · Fixed by #5164

Comments

@alexander-yakushev
Copy link

alexander-yakushev commented Sep 1, 2015

I'm sorry if this is answered elsewhere but I couldn't find it in that case.

I want to replace my current Owncloud+Owncloud client (Linux)+FolderSync(Android) setup with Drive+Rclone+FolderSync. But there is one thing I can't figure out how to do with rclone — smart two-way deletion synchronization. Which means: if a file was present on both server (Drive) and local machine, and then was deleted on either of them, the file will be eventually removed on both regardless of which direction you run sync first. Same, if a file was added on either server or client, it will be uploaded to the other one.

Can rclone do that, and if doesn't is there a chance of such functionality in future?

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
@ncw
Copy link
Member

ncw commented Sep 1, 2015

No rclone can't do that yet.

However it could be done I think. Rclone would need to store a little bit of metadata - time of last sync. It could then use that for working out what to do in the delete files case.

@alexander-yakushev
Copy link
Author

Thank you for the prompt response!

@ncw
Copy link
Member

ncw commented Sep 2, 2015

I've made a note about this for the FAQ - I'll leave this ticket open for future developments!

@ncw ncw added this to the Unplanned milestone Feb 10, 2016
@nigelhorne

This comment has been minimized.

@ncw
Copy link
Member

ncw commented Sep 14, 2016

None at the moment. All the primitives needed are there in rclone, it just needs a 2-way sync expert to fill in the gaps!

@Technifocal

This comment has been minimized.

@ncw ncw changed the title Correct two-way synchronization Two-way (bidirectional) synchronization Sep 19, 2016
@bmlong137
Copy link

bmlong137 commented Oct 3, 2016

I think a basic "2-way-sync" could be achieved with two commands. Execute "rclone sync -u " followed by "rclone sync -u ". Obviously doesn't work if both sides are changed, but what generic solution will?

@allanlaal

This comment has been minimized.

@nu111
Copy link

nu111 commented Mar 25, 2017

It would be great to have 2-way bi-directional sync!
This way rclone would be a great open-soruce alternative to odrive!
Maybe we could get inspired by the MEGAsync client https://github.com/meganz/MEGAsync

@supagu

This comment has been minimized.

@benji791

This comment has been minimized.

@wilbowma
Copy link

FWIW, I'm currently using Unison for two way sync via ssh (https://github.com/bcpierce00/unison). I was considering trying to use rclone, since I use rclone for other syncing. Unison is written in OCaml, so you probably can't reuse the code directly, but it might provide a starting place for developing a good two-way syncing algorithm. It's an academic project with several publications about Unison, http://www.cis.upenn.edu/%7Ebcpierce/papers/index.shtml#File%20Synchronization, which might also be of help.

@hildogjr
Copy link

There is also the python @cjnaz work around (I tryed to did some improvements https://github.com/hildogjr/RCloneSync/). But still just a work around.

@cjnaz
Copy link
Contributor

cjnaz commented Apr 27, 2018

See https://github.com/ncw/rclone/wiki/Third-Party-Integrations-with-rclone for RCloneSync which points to https://github.com/cjnaz/RCloneSync. This is my original version that I've been running for since July 2017. The README.md has an in-depth discussion of the nuances of bidir sync. @hildogjr has updated this for Python 3 support, Python style standards, standardized Linux command line arguments, and added a few features. I have yet to merge his pull requests, but they look good. I would recommend his version (link above) but the core functionality is unchanged, I believe.

@yonjah

This comment has been minimized.

@hildogjr

This comment has been minimized.

@deeuu

This comment has been minimized.

@hildogjr

This comment has been minimized.

@cjnaz
Copy link
Contributor

cjnaz commented Jun 27, 2018 via email

@deeuu

This comment has been minimized.

@cjnaz
Copy link
Contributor

cjnaz commented Jun 27, 2018 via email

@cjnaz

This comment has been minimized.

ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 7, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 7, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 7, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
@ivandeex ivandeex added the bisync label Oct 7, 2021
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 8, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 8, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 8, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 15, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 15, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 15, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
@ivandeex ivandeex modified the milestones: v1.57, v1.58 Oct 20, 2021
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 20, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 20, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 20, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit to ivandeex/rclone that referenced this issue Oct 21, 2021
Fixes rclone#118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
ivandeex added a commit that referenced this issue Nov 1, 2021
Fixes #118

Co-authored-by: Chris Nelson <stuff@cjnaz.com>
@ivandeex
Copy link
Member

ivandeex commented Nov 1, 2021

Merged on master.
Beta released on https://beta.rclone.org

@typxxi
Copy link

typxxi commented Nov 1, 2021

I guess it will become a present for chrismas or eastern cause I wanna avoid the risks of betas.
thx

@Harvie
Copy link

Harvie commented Nov 2, 2021

Merged on master. Beta released on https://beta.rclone.org

Nice :-) Will this work in star topology? eg.: multiple devices doing bidirectional sync with shared directory on the server?
I am looking for dropbox/googledrive replacement. So my data is available when offline and will resync later to ordinary SFTP server with no server side software.

@ivandeex
Copy link
Member

ivandeex commented Nov 2, 2021

@Harvie
This ticket is about BASIC 2-way sync.
It is closed. It will not handle advanced use cases.
We predicted further questions about applicability to other topologies.
Please post your question to the closest related ticket #5689
Thank you.

@cjnaz
Copy link
Contributor

cjnaz commented Nov 2, 2021 via email

@gerardbosch
Copy link
Contributor

gerardbosch commented Feb 17, 2023

Hi there, what are the known backends that "support file modification time"? I was trying with mega.nz as it offers good amount of free storage and strong security. But after trying bisync I got the error:

Failed to bisync: modification time support is missing on path2

I'm wondering about free and good alternatives I can use. I liked also mega.nz as their application is very lightweight compared to something like Dropbox app that eats a lot of RAM. But on an old low spec Windows server I wanted to use rclone as the mega app does not work (requires extra stuff to be installed).

I guess that nothing can be done with mega, at least right now. Any ideas or recommended free backend compatible with bisync? Thanks!

@Jwink3101
Copy link
Contributor

Hi there, what are the known backends that "support file modification time"? I was trying with mega.nz as it offers good amount of free storage and strong security. But after trying bisync I got the error:

Failed to bisync: modification time support is missing on path2

I'm wondering about free and good alternatives I can use. I liked also mega.nz as their application is very lightweight compared to something like Dropbox app that eats a lot of RAM. But on an old low spec Windows server I wanted to use rclone as the mega app does not work (requires extra stuff to be installed).

I guess that nothing can be done with mega, at least right now. Any ideas or recommended free backend compatible with bisync? Thanks!

This really is a better question for the forum. But see the remote overview

Also, I am the author of syncrclone which can support remotes that don’t support modtime. It has pros and cons. See my comparison

@gerardbosch
Copy link
Contributor

gerardbosch commented Feb 18, 2023

Thanks @Jwink3101 for your answer, and sorry for posting here the question that belongs to the forum –just landed here looking for the bisync error :)
Now that I see the link to the remote overview, I think that Google Drive will perfectly meet my requirements (supports ModTime R/W), just in case it helps someone else. Not 20GB but 15GB of free storage, still enough =)

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

Successfully merging a pull request may close this issue.