Detect when folder has finished transfering

Is there a way to detect when the folder has finished transferring (i.e. sync is at 100% on the syncthing webui)?

I am looking to run a script to move the contents of the synced folder after all files have finished transferring.

You can, by using the REST interface, but it’s somewhat involved…

Thanks for the tip, I seem to have figured it out. All of the servers involved are VPSes on the internet with shared 1G ports, so I simply run

curl -s http://172.16.1.106:8080/rest/model?folder=DLSync | python -c 'import sys,json;data=json.loads(sys.stdin.read()); print data["needFiles"]'

every minute (via cron) along with a counter. If 10 minutes have passed with neededFiles staying at 0, I simply move the folder out.

2 Likes