Syncthing handling of sub/hidden folders

I just installed Syncthing, and have a Sync folder (~100k of data) for config files that I maintain between multiple computers. Today I added a hidden subfolder, (.task) to both of two clients. One client had two files that were blank. However, on the other client that had real data in those files, they were replaced with empty files, with no backup under .stversions or .stfolder. This is really frustrating, as all of my other files have backups under .stversions, but none of my files have backups and I lost a lot of data. What can I do to ensure I don’t delete my data, and that Syncthing takes proper backups? I have versioning set to simple on all clients. But I see no .tasks folder under .stversions or the files I’d expect under there. Does syncthing not support sub folders for backups?

Syncthing is not a backup tool, as you’ve just realised. .stversions makes copies of files before others modify it, so I’d check .stversions directory on the other device.

Versions do work across subfolders

You don’t say : stable or rc ?

Whatever : it seems I also meet this issue for hidden subdirs when fsWatcher is enabled, which is default nowadays. modifier device being 50rc2, remote one being 14.49 stable (linux both side). No this issue with fsWatcher disabled.

Well this is well known, Audrius, but when you unshease this argument, maybe you would hope ST isn’t the soft that triggers us to run our third party backup tool :wink:

Not sure what you mean by hidden subdirs

There seem to be many different issues here:

That in itself should not happen. If there is a concurrent change, both files must be preserved, one as a conflict.

Backup should be in .stversions, not .stfolder. However if it was treated as a conflict (which it should), no versioning should have taken place.

Have a second line of backups. Enabling versioning on all clients is a good measure to protect your data, but it’s not enough. Use a real backup tool to secure your data.

I fail to see how the watcher can have any influence on versioning - there is no connection between the two parts in the code. However failing to see isn’t can’t be, so please explain what exactly you do and what then happens instead of what you expect.

I tried again and didn’t reach to get the ~issue~ again.

Hey, I’m actually able to reliably repo this. Where can I file a bug report on it? Here are steps to reproduce. Desktop: 0.14.49-1 Android: 0.14.49-Dirty Laptop: 0.14.47

Desktop knows about Android. Android knows about Desktop and Laptop. Laptop knows about Android.

  1. Have a base folder up to date with all clients (Sync)
  2. Shut down Syncthing on laptop
  3. Create folder named .temp under base folder on Desktop
  4. cd ~/Sync/.temp
  5. echo “HelloWorld”>./test.txt
  6. Repeat steps 3 and 4 on laptop
  7. touch ./test.txt
  8. Wait until Android and Desktop have sync’d
  9. Enable Syncthing on laptop
  10. Verify that on Desktop and Android, Sync/.temp/test.txt is empty, no conflict files exist, and no updates exist under any client’s .stversions folder

What does step 8 mean if syncthing on the desktop is off?

Killamus says Laptop’s ST is off. Aren’t empty files with same name a corner case (same hash whatever the touch date) ?

[EDIT] discard the above : test.txt is not empty on desktop

BTW Killamus, IIUC the result of your scenario is as intended : even ST is off ATM you touches test.txt on the laptop, when you fire ST up then the latest changed file is duplicated to other devices : the latest changed is the one on the laptop.

the only thing not intended is there is nothing in .stversions.

Please confirm : you use the android device as an intermediary between Desktop and Laptop, isn’t it ?

Nope. The touched file being newer means it will stay and the other will be renamed to a conflict file - as the change happens simultaneously it will be a conflict.

I assume starting Syncthing again on the laptop is part of step 8. Must have been asleep (see 9.)

I guess this word has a specific meaning here (not the time of physics). Something like “in the same round of an index exchange” ? You can see I’m not aware of all subtilities of ST :wink:

Simultaneously in this context is from the perspective of Syncthing, i.e. the change on laptop happens before the change from desktop is synced to the laptop.

Then am I right to understand that on startup ST first scans folders’ local content before he handles (changes) info from remote ?

Hey, yeah, that’s right. I do, as my laptop and desktop are rarely on at the same time, plus, all files that I need on my laptop are also needed on my android (Taskwarrior files, keepass DB, etc). I did expect a collision/replacement, not a deletion of the file contents.

Yes, but it doesn’t matter. Even if the local change wasn’t yet picked up by a scan, on pulling the remote content Syncthing does check that the file to be replaced corresponds to what we expect. If it doesn’t (i.e. it was changed) it is not replaced and a scan is scheduled.

Also, to be clear, there are other files in the .stversions folder. My cherrytree files, as an example, have 5 revisions as it’s common for me to alternate my updates between my laptop and desktop.

You need to revisit your steps and explain in detail how to reproduce, you steps so far don’t make much sense as I understood 2 devices which somehow sync while one doesm’t have syncthing running.

Also, are you aware of android is a bit problematic with ST? Case insensitive also. I wouldn’t like to have an andoid between 2 nuxes.

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