newhinton / Round-Sync

An android cloud file manager, powered by rclone. Visit https://roundsync.com for more information!
https://roundsync.com
GNU General Public License v3.0
1.21k stars 48 forks source link

rclone Bisync support #17

Open jthvai opened 2 years ago

jthvai commented 2 years ago

Pre-Submission checklist

What version of RCX extRact are you using (About -> App version)?

2.0.2-dev

What problem are you trying to solve?

Avoid running two trigger-based tasks with one-directional Sync, which is not recommended by ncw, rclone dev. Also in the same thread, a setup with two trigger-based one-directional Copy tasks does not allow for deleting files.

What should RCX be able to do differently to help with this problem?

Support rclone's native bisync, available as of rclone v1.58.0. This has been briefly brought up in an rcx issue.

newhinton commented 2 years ago

I have read about it, but did not get around to play with it. It is definitively on my roadmap!

newhinton commented 2 years ago

I have investigated bisync. It seems it is rather easy to integrate, and it should not be a problem to use it on devices with android 7 and above.

Due to https://github.com/rclone/rclone/issues/2446, it will probably be impossible to make it work, but since those versions are not supported anyway this wont be a problem.

newhinton commented 2 years ago

This will be delayed. Bisync required two different types of commands, depending on the state of rclone, This requires a lot of error-catching and checking, something that is currently not easily possible due to the way this app is structured.

See https://rclone.org/bisync/#error-handling

wkornewald commented 1 year ago

Do you have any update on this feature request? Bidirectional sync is basically the only sane way to keep data in sync between multiple devices (e.g. the photo library shared between phone and laptop via NAS). Unidirectional sync is only useful for non-shared backups, but that case is handled much better with incremental backups that keep a file history (like Restic or Borg or Time Machine etc.).

thecoffeebin commented 11 months ago

Hi, just tried out RoundSync and it's awesome! Thinking to replace AutoSync or FolderSync but sadly there is no two-way sync (or Bisync) in RS which is important to share files between devices. Hopefully you can consider to implement this.

Thanks.

Asmageddon commented 9 months ago

+1 Most usecases other than backups strictly require bidirectional sync unless one is alright with losing their data. Was really hoping this app would support it since rsync does, nowadays, but alas.

newhinton commented 9 months ago

Bisync is not going to happen anytime soon. I am the only dev, and this requires a lot of changes to be made to the core parts of this app. I simply dont have the time (and, to be honest, the need for bisync) to make such changes, not while other issues are more pressing.

PR's are welcome as always, but for the forseeable future i am not going to spend time on this.

jonaslomp commented 5 months ago

Hello, I just looked into it because i want this, In app/src/main/java/ca/pkay/rcloneexplorer/Items/SyncDirectionObject.java

 // The first time a bidirectional sync is used, it hast to use --resync. https://rclone.org/bisync/
public static final int SYNC_BIDIRECTIONAL_INITIAL = 5;
public static final int SYNC_BIDIRECTIONAL = 6;

-resync should not be done automatic, it should be something the User needs to Trigger and confirm that files in Target will be overwriten, also because of this BiSync needs direction, so the user can decide what gets overwriten. I would do

public static final int SYNC_BIDIRECTIONAL_LOCAL_TO_REMOTE= 5;
public static final int SYNC_BIDIRECTIONAL_REMOTE_TO_LOCAL = 6;

And then threat bisync like a normal sync with a boolean doResync as last Argument of the Sync function in app/src/main/java/ca/pkay/rcloneexplorer/Rclone.java (like with useMd5Sum)

When bisync fails so it needs a -resync, the user should do it based on the LOGS or maybe as a hint a notification, on the next time the Task tries to run.

aloni636 commented 4 months ago

Hi, I also want this feature. @jonaslomp, is there any way I can collaborate and help pushing this forward?

jonaslomp commented 4 months ago

@aloni636 I'm not sure how much sense it makes to do it, because i don't know if @newhinton would accept the PR after #258.

On the other hand, one could overhaul the sync() function to make it more flexible, for example give remotes the option to have arguments that are always taken when the remote is used. There is already a version without useMD5sum doing this for any argument that might be needed is not really an option...

Newdea commented 1 month ago

+1, I also want this feature.