Hi, Recently, someone posted a suggestion that the .stignore system be able to ignore/include files based on modification time, or in other words based on the age of the file. At the same time, I was thinking about ways to adaptively limit the amount of data kept on local “client” machines (treating, say, a NAS as the “server” even though Syncthing is peer-to-peer). Initially I was thinking of resurrecting the SyncthingFUSE project to create a cached virtual filesystem, but after seeing the other suggestion, I thought it might be easier to look into a melding of these two ideas, for example, so that for a given directory, rather than the most recently used files existing on the client, the newest files exist on the client, up to a disk usage limit set by the user. I thought maybe the .stignore system could be used for this, so I downloaded the source code.
But first I decided to see how the .stignore system currently works, and from experimentation, found out a few things:
If I have a file that is synced, and then add it to the local .stignore file, the file does stop syncing, but it also remains on the client, which I wasn’t expecting. If I then delete the file on the local machine, everything seems fine. But if I then remove that filename from .stignore, the delete suddenly becomes recognized and gets propagated to the other machine. This seems a bit dangerous. I initially expected the behavior to be more like Dropbox, where when you exclude a directory (using selective sync) it immediately disappears from the local system and is treated as if it was never synced in the first place, so you don’t propagate deletes back to the other systems if you re-add it later.
Given this behavior, in order to implement something like what I was thinking, it seems that the behavior of the .stinclude system would have to be changed significantly, so that files are removed from the local system as soon as they are excluded, and that they should be treated as if they were never synced, so they can be re-included without it being interpreted as a delete. This makes me think that it might be too big of a change and perhaps I should consider going back and attempting to resurrect SyncthingFUSE.