Hey everyone,
I was just wondering about something, because I could not get a sense of what Syncthing does in case when a file gets corrupted (e.g. by bit rot) in one of the devices. From other forum posts I found it sounds like there isn’t really anything special that happens.
But when I read through the code a bit, it seems like what is happening in such a case is still decent, but I wanted to confirm with some Syncthing devs to see if my thoughts on this are correct.
So I’m guessing that when bit rot happens, syncthing will not necessarily know about it, and at some point may discover on accident that the content of the file does not match the hash for it in the index anymore. Such as when that specific file has been requested by another device. When Syncthing has found that the file is not matching its hash anymore, it will ‘rescan’ the file, and update the hash of the file as if it was any other change. Then the difference of hashes across devices will cause a sync conflict to happen, which can be resolved like any other sync conflict can.
Are my assumptions correct?
Also, because files may never be touched or read for a very long time, it would be nice if there was some way, maybe a cli command, to do ‘full scan’, to rescan all already indexed files of the folder, so that these corrupted files can be detected, and sync conflicts can appear to the user. I would be really happy if I could set something like that up in a cron job, but does something like that exist?