Syncing files that are in use (Windows)

I want to update database of the program that works non-stop. After it starts it loads sqlite db and on Windows it becomes locked until the program exits. This prevents me from syncing the db until I exit the program which is cumbersome.

Is it possible to run script on before and after the sync (i.e. hook)? In those, I would close the tool before syncing and restart it afterwards so that sync can continue.

Any other solution for this problem ?

The process cannot access the file because it is being used by another process.

Not really :pensive:. Even if there was a solution (e.g. utilising shadow copies), there is no guarantee that such an open database would be copied in an actually workable state. In other words, the synced file may very well be completely broken and unusable.

If you really want to sync such locked files though, you can work around the problem by using a different solution in order to copy the files to a different folder first, and then point Syncthing at that folder instead.

Remote updates could happen not that often so script can restart the app when it does. If its often, then no bueno.

Local updates definitely need Shadow Copy. Not sure if it can work on single files efficiently rather then on volume.