How to resume syncing an ignored folder that does not exist on my device?

As I have a complex structure and dont wan’t to create thousands of syncthing folders I wanted to work with .stignore files. Until I realized that I can’t use them to exclude folders from syncing and download it later if I need it.

Because when I create a sub-folder in my synced “Media” folder, let’s say “Holidays Summer 2019”, add all my pictures and videos (which can be quite a lot). Then I wait for complete sync with my server (which is my other always on device). Afterwards I exclude the folder in my .stignore file. Now I can delete it without any issues, means the files will stay on the other synced device. So far it’s fine… a good workaround for partial folder sync. Now the problem starts: I want to check the pictures again, so I remove the exclude line from my .stignore. Unfortunately syncthing starts to delete all files now on the server instead of recreating them on my machine.

Is this issue solvable with existing workaround? Thanks for your help!

No, not really. You could try touching the files that were deleted so they are pushed back to the device.

There is also an ignoreDeletes option which might be more suitable for what you are doing.

Thanks for your workaround. Unfortunately this seems to be not a very handy solution. I created a feature request - I dont know anything in detail about the application architecture - but it seems to me an elegant solution for a nasty issue which should bother lots of syncthing user. -> New modifier "exclude from this device for the moment" for .stignore

If I understand your problem, you are trying to sync a populated folder with an empty folder, & trying to ensure that files are not deleted from the populated folder.

Would this solve your problem?

On the folder that contains the files, go to Edit / Advanced / Folder Type, & set it to Send Only.

Once the 2 folders are in sync, set Folder Type back to Send & Receive.

Thanks for the idea.

A workaround that could probably work is: Before removing the exclude statement, I need to set the correct sync folder (need to be super careful here not changing the wrong) to “receive only”. Then it should restore the files I guess…

Note: this workaround didnt work… It ended up in “Out of Sync” (seems to be a bug, maybe it would work otherwise) besides the issue that you need to think a lot to simple resume a folder sync, without doing any mistake.

I tested it by creating 1 folder with another folder and one text-file in it. Then I waited for sync. Afterwards I added it in .stignore. Then I deleted the folder. To resume I changed the sync folder to receive only, then removed the exclude in .stignore and clicked on revert. Interestingly it created two folders but no file and still showed the “revert” button. So I clicked it again and then the sync folder was out of sync.

EDIT: For whatever reason (I tried rescan and pause/resume etc a few times before) it healed itself while writing this post. Now it shows “in sync” and the three files are restored. Great… but I’m not sure if I should be scared about huge amounts of production data.

EDIT 2: Something else happened too… two conflict files that were removed automatically at the end… Their name was prefixed with .syncthing. But after changing it to send&receive folder, both disappeared after a short while.

I don’t quite understand what you tried in the end, however what you describe originally should work and will work in the next release, see https://github.com/syncthing/syncthing/issues/6038

That aren’t conflicts. Conflicts have a suffix that labels them as conflicts. What you saw are temporary files created while syncing. They disappear when syncing finishes or after 24h if syncing was aborted for whatever reason.

For the archive: this issue will do the trick. Thanks!

Thanks for clarification!

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