-
I'm struggling to have a script/application detect that syncthing is changing state from "syncing" to "idle". My goal is to start such a script/application on system startup, wait a bit until it detects folders are idle, indicating sync is complete, then exits 0, signalling to e.g. autostart my text editor (Emacs/Neovim). At first I tried polling at .1 seconds using the API:
but Syncthing always reports 100% completion. What happens after I create a 1GB file on the server to sync to the local machine is that it goes from showing no file to the 1GB file in an instant, which I assume is why it always show 100% completion (i.e. the file doesn't "grow" as it is syncing--it either shows up on the local machine as the full file or it hasn't "synced" yet. I'm sure my internet connection is not this fast--I get 11 MBps transfers between the systems. I also tested event API counterpart and it's the same story. I tried
The first command always shows I suspect syncing completion % reporting has more to do with many files, so I copied 500M worth of low quality pictures and actually see "preparing to sync" for a brief second before seeing "idle" in the first command. However, the I'm on Linux. Any suggestions is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If the web GUI doesn't show the folder as syncing then there's nothing Note that I can not generally reproduce what you're describing. On the downloading end the relevant folder is in the synchronizing state as long as the download takes. On the uploading ends the relevant remote device is in the synchronizing state as long as it lacks behind the latest version (for whatever reason). This works reliably for me. When files are changing continiously the change might not be immidiately detected by Syncthing. This is obviously because Syncthing only scans in certain invervals and even when file system watchers are enabled it makes totally sense for Syncthing to back off shortly instead of inefficiently picking up every little new chunk of data individually. Due to this a folder may appear idle when it in fact isn't. The Considering the official web GUI doesn't show the status correctly as well in your setup this seems to be a backend issue. My own insights are rather limited in that regard. So I suggest you file an issue on the core Syncthing project's issue tracker or ask in the official forum. Possibly you need to provide more details, though. |
Beta Was this translation helpful? Give feedback.
If the web GUI doesn't show the folder as syncing then there's nothing
syncthingctl
can do for you. It basically just queries the same API as the web GUI. Possibly it has some extra bugs but certainly it is not better than the web GUI.Note that I can not generally reproduce what you're describing. On the downloading end the relevant folder is in the synchronizing state as long as the download takes. On the uploading ends the relevant remote device is in the synchronizing state as long as it lacks b…