Run condition suggestion

would it be possible to add a run condition that turn on syncing on Android only when the other selected device is on? For example if my PC would be detected as online, Syncthing would get out of sleep and start running and when the PC is detected as disconnected, it would go back to sleep. I think this would save so much time and battery on the phone side and would also make so much sense as it’s not needed to run at all times (I know about the interval run) if there is no other device to sync with.

How would Syncthing “know” that the other Device wasn’t available without trying to connect to it?

I have noticed that even when the Syncthing is sleeping on my mobile, because I have put some run restrictions for every 45 min, when I look at the connected devices still reports them as connected or disconnected. From this I think it would be possible.

When Syncthing isn’t connected to a peer, it isn’t doing a whole lot other than checking in with Discovery and Relay servers (both of which can be turned off) tracking local changes, and of course trying to reconnect to its peers from time to time. It’s that last part that shows whether another Syncthing Device is connected.

In other words, it isn’t clear to me what you’re asking for. There already is a mechanism for Syncthing to check if another peer is up.

thank you for clearing it all out. I’ll look more into the app’s settings. Could you please tell me where I can find more in-depth options to tune how it works? or is it all just the run conditions?

I’m not sure what you mean here by “run conditions” but the full documentation is at https://docs.syncthing.net/ —- my experience with the Syncthing docs has been excellent.

To be clear on this point: Syncthing already detects if its configured peers are up, by trying to connect with them. Syncthing has to be running to do that.

Turning off Discovery and Relaying can be done via the GUI in Actions/Settings/Connections.

For myself, I leave Global Discovery on for when one of my Syncthing Devices travels with me, so that it can use the Global Discovery servers to find and be found by its peers. I leave Local Discovery on so that I don’t have to manage how Devices find each other on my home network. And I leave Enable Relaying on and Enable NAT Traversal off because I do not choose to use firewall rules for direct exposure of my Syncthing Devices to the Internet. Also, I have UPnP turned completely off on my home network.

My Syncthing use cases and security needs may be different from yours. What I do works well for me.

This is about the now discontinued Android app. Unfortunately, the app has never been covered by the Documentation.

1 Like