Skip to content

bisync: implement --track-renames #5690

Closed

Description

@ivandeex

What problem are you are trying to solve?

bisync does not honor --track-renames !

How do you think rclone should be changed to solve that?

bisync should honor --track-renames ?

Also see cjnaz/rclonesync-V2#71

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.

Activity

  1. added this to the Soon milestone on Oct 8, 2021
  2. self-assigned this
    on Oct 8, 2021
  3. f0k commented on Oct 8, 2022

    @f0k

    Hello, I'd just like to know what's the progress on this feature. Is anybody planning to work on this soon, or is it a low priority? Is there anything I can help with, without speaking Go? As far as I see, compared to a unidirectional sync, this would require keeping a full listing of the last known synced state, in order to figure out where a rename took place.

    For context, my use case would be keeping a directory on my phone in sync with a NextCloud server, where files can be added, deleted and renamed/moved on both ends. My options seem to be a) finding a software solution that supports this, b) renting a (twice as expensive) server I can run Syncthing on, c) writing a Python script myself. Rclone seems to be close to a), hence I'm curious. By no means I intend to beg anyone to implement this feature sooner!

  4. nielash commented on Jul 12, 2023

    @nielash
    Contributor

    Hello, I'd just like to know what's the progress on this feature. Is anybody planning to work on this soon, or is it a low priority?

    @f0k I just submitted a PR that should significantly improve this (albeit in a slightly different way.) Files and folders can now be renamed on both sides without needing to re-upload, or do a --resync, or end up with erroneous ..path1 and ..path2 versions. (However, the behavior is unchanged when a rename is on only one side.)

  5. f0k commented on Jul 12, 2023

    @f0k

    Nice! However, if I understand correctly, this does not help when a file is renamed only on one side and I would like the change to propagate to the other side without incurring a retransmission.

  6. nielash commented on Jul 12, 2023

    @nielash
    Contributor

    Nice! However, if I understand correctly, this does not help when a file is renamed only on one side and I would like the change to propagate to the other side without incurring a retransmission.

    You are correct.

    As a note to anyone revisiting this later (possibly me), I think the technical limitation currently is that --track-renames doesn't work with copy, only sync. Whereas bisync uses copy to transfer the queued files to the opposite path, and then it does the queued deletes in a later step. Here's the line where it calls CopyDir:

    return sync.CopyDir(ctxCopy, fdst, fsrc, false)

    which then calls runSyncCopyMove with fs.DeleteModeOff hard-coded:

    rclone/fs/sync/sync.go

    Lines 1141 to 1144 in 415f4b2

    // CopyDir copies fsrc into fdst
    func CopyDir(ctx context.Context, fdst, fsrc fs.Fs, copyEmptySrcDirs bool) error {
    return runSyncCopyMove(ctx, fdst, fsrc, fs.DeleteModeOff, false, false, copyEmptySrcDirs)
    }

    fs.DeleteModeOff precludes --track-renames:

    rclone/fs/sync/sync.go

    Lines 208 to 211 in 415f4b2

    if s.deleteMode == fs.DeleteModeOff {
    fs.Errorf(fdst, "Ignoring --track-renames as it doesn't work with copy or move, only sync")
    s.trackRenames = false
    }

    I think it should be possible (and desirable) to support --track-renames for bisync, but it would take a bit of rethinking about how bisync queues work.

  7. modified the milestones: Soon, Known Problem on Sep 5, 2023
  8. added a commit that references this issue on Oct 1, 2023
    e2a4f92
  9. modified the milestones: Known Problem, Soon on Nov 8, 2023
  10. 4 remaining items

  11. added a commit that references this issue on Jan 20, 2024
    0e5f121
  12. moved this to Done in bisyncon Aug 20, 2024
  13. added a commit that references this issue on Jul 20, 2026
    49b8343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions