Massively out-of-sync directories

I don’t know if this is possibly a side-effect of my previous post but I updated a whole lot of tags in my music directory on the desktop today, and hoped to just push the updates to the laptop. What seems to have happened is that the laptop is now reporting a global state of almost two thousand more files than what the desktop says it has, despite me having deleted files from the laptop and not the desktop. It adds up to a difference of about 30 GiB, and I’m not entirely sure what’s happened here.

What’s even stranger is that these deleted files from the laptop are being recreated, although I set ignoreDelete at both ends. EDIT: The documentation says this particular occurrence is expected behaviour, which isn’t really what I want :confused:

The underlying filesystem on both computers is Btrfs, which doesn’t do in-place overwriting of files, and Musicbrainz itself does a convoluted move-and-rename operation when you save tags. I don’t know if this could’ve confused Syncthing, but it’s the only other thing I can think of that might have resulted in this discrepancy.

If the file names have changed and you have selected do not delete on the laptop you have essentially created files that the laptop will see as brand new. It will not remove the files of the old name and will copy any blocks that didn’t change in the old files to create the files with a new name.

1 Like

You’re doing something (the both-directions-ignore-deletes) which is tricky, confusing and after a while yields almost meaningless numbers in number of files in sync / out of sync / global etc. You probably need to simplify that or think really hard about what’s going on with each file and how that affects the sync operation and accounting.

But yes, a “deleted” file that gets changed will get resurrected. Apart from that I’m not really following your setup well enough to comment intelligently. :wink:

I wanted to keep my music collections relatively synchronised between the two computers, so that in general any additions or file changes made to one would propagate to the other. However, I also want to be able to let the two diverge slightly as well, so that I could remove files from the laptop but not get them deleted from the desktop, preferably with the delete operation also blacklisting the file.

Thinking about it now, it is a really complicated setup, with a whole raft of edge cases that would be difficult to resolve. It’s possible I might be able to achieve the desired results with lots of .stignore files—ignoring the laptop’s deleted files on the desktop would prevent them being sent to the laptop—and adding corresponding ignore directives in directories that have diverged on purpose, such as replacing a FLAC album with an MP3 one to save space on the laptop. However, this approach would prove utterly unworkable if I ever added another machine to the cluster.

It’s a lot of extra work, simply because it would be near impossible to automate exactly what files I want synced and what ones I don’t without some kind of scripting ability, and that goes well outside what Syncthing is aimed at right now. That being said, I can envisage other use-cases where such abilities might be quite useful for advanced users, but this is in the far future when Syncthing is at version >2.x and has displaced BTSync and Dropbox :wink:

I think for the time being I’ll just be content that the two collections are largely mirrored, and I’ll use an intermediate “staging” directory to synchronise files on an as-needed basis.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.