Automatically revert local changes

I’ve got a directory shared between two SyncThing instances. The directory is “Send only” on the source, and “Receive only” on the receiver. Some of the files on the source are very large (60-120 GB). Others are still large, but not quite as large (5-10 GB).

These files are backups of various systems with file revisions, so when the backup software starts modifying the contents of one of those 60-120 GB files, it may take anywhere from 15 minutes to 2 hours depending on how many changes were made.

My best guess is that SyncThing starts to push the changes to the receiver before the backup software is done, and then more changes are written before that push can be completed. As a result, I often get “Local changes” on my receiver, which I have to fix with “Revert local changes”.

There are no true local changes, as in this situation, the sender will always be send only and the receiver will always be receive only. The receiver should only ever mirror the sender for what I’m using it for. Is there a way I can automatically revert local changes on the receiver, or another solution to my problem?


Thanks, the script in the second link will be handy. Is there a better way to handle the behavior of syncthing with what I’m trying to use it for, rather than depending on reverting local changes? (Extending the wait time when a file is modified before it’s sent, or waiting until N minutes after it was last written to before it’s sent?)

If it’s a large file being generated that isn’t valid until it’s done I would hope it’s generated under a temporary name of some kind and then renamed at the end. In that case I’d ignore the temporary files.

Alternatively, disable file system watching and set the scan interval to something long like an hour. It might still rescan in the middle of the operation, but at least you’ll get just one or two attempts until it’s quiescent.

Got it. Thanks for the reply!

If the backups software can run a “script” when backup is finished, you could disable normal scan and trigger the scan via API, when the backup is done.

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