I know that syncthing has rest api calls and event polling API calls like ItemFinished. What I want is to make a call to my rest api with the file which completed synchronization once file sync is completed. or Is it possible to configure a script using syncthing which syncthing will trigger automtically once file sync has been completed with the name of the file.
So what I am looking for is a asynchronous trigger from syncthing side rather than me polling the syncthing apis.
No, but you can write something that listens to events and then fires off webhooks.
No, but there are better ways to accomplish what you’re asking for…
Linux, macOS and Windows all have variations of filesystem event notifications. It’s more portable because it will work with any program that manipulates files in a filesystem.
You didn’t mention what OS platform(s) are being used so check out the tool fswatch – https://emcrisostomo.github.io/fswatch/
If you’re using Linux, there are even more options available that make use of the Linux kernel’s inotify subsystem.
I have a Linux system that receives files via Syncthing, and in particular, there’s a XML file that needs to be processed and the results used to update a key/value store database. However, the XML input file isn’t updated per a schedule – sometimes it goes unchanged for months at a time. So my database update script waits for a trigger that’s pulled by a specific filesystem event.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.