Request: Scheduled sync until completion

I would like to sync some folders from my Android device every day, say at 3AM, until completion.

The only similar option I can see right now is to sync for a specified amount of time on a schedule. This isn’t great, because it is not known ahead of time how long a sync will take.

Also, I couldn’t find any information about whether this existing option will force a folder rescan for all directories when the interval starts. If it doesn’t, then this setting could easily result in changes slipping by undetected (because folder rescans might never run).

1 Like

Here’s how you might do this:

  • Set up Syncthing the way you want it, as though you were going to run it full time
  • Use the CLI or API to pause the Device
  • Set up cron or the appropriate tool to schedule your script to run at 3am
  • Have your script query the API for folder completion status on a schedule
  • Have your script use the API to pause the Device when all the Folders come back as Up to Date

I’m almost 100% certain that unpausing after a full scan interval will kick off a full rescan.

If I’m wrong about the full scan, take a look at POST /rest/db/scan — Syncthing documentation — you can use the API to kick that off too.

Thanks and I might try this, but I would still prefer for this to be part of the android app. Scripting on android is cumbersome, and I think this would be a very reasonable feature to add.

I don’t disagree with you about the feature.

Two workarounds to consider for scripting: Would a script that paused the connection from the Remote Device(s) side work for your use case?

And if you use a mesh VPN (I used to use Nord and now use Tailscale) you can set the GUI listen address on your phone to the mesh VPN IP and take API actions on your phone from another mesh VPN peer. There may be some complexities on Android that make this impractical — I am not an Android user.

Oh, now I understand. I didn’t know that you could pause a device from another device. I’m not sure if pausing will save as much battery as fully shutting down syncthing would (which is what syncthing-fork does). There is also the problem of disconnects (what happens when the device is unpaused remotely, then loses connection?). I think that would be a brittle system.

I don’t use any mesh vpns.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.