I use Syncthing for several weeks and I’m very surprised. I don’t want to run Syncthing all the time. I start it manually usually once a week.
Question: Is there a possibility to configure Syncthing that it is automatically closed after syncing has finished (when all folders are up-to-date)?
There is not, unfortunately.
It’s also a teensy bit trickier than you’d expect.
Maybe you use a script (e.g. bash or python) which starts Syncthing, waits for a while, checks how Syncthing is going with the REST API and / or EVENT API, and then shutdown Syncthing with the POST /rest/system/shutdown command.
I’m not really sure which API endpoint you’d use to check if Syncthing was “finished”. As Jakob mentioned, this might be the tricky bit.
Yeah I could have been a bit more explicit, but was typing on the phone. I’ve actually wanted this feature myself. Thing is though, assuming we were in sync when Syncthing was shut down we will still be in sync when Syncthing starts up. We must then connect to other devices in order to realize we are possibly not in sync. But not all other devices might be online or reachable. Do we wait forever or just a while? What if one device disconnects and another connects during that time? Do we wait for other devices to become in sync or just ourselves? What if they can’t? etc.
(rsync or unison, on the other hand, are great at just starting up and doing a one shot sync before exiting)
Thanks for the comprehensive information. Yes I can imagine, that it is not easy to decide. Ok, I will do it manually by looking into browser state.
I used unison before, but it needed more time and it didn’t work anymore on my Android mobile phone. I’m very happy to have Syncthing. Thanks for such big work.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.