Scheduled Scan Times for folders — feature + PR ready

Hi everyone,

I’ve implemented a small feature I was missing: an optional per-folder Scheduled Scan Times setting. Instead of only a fixed periodic Full Rescan Interval (or real-time watching), you can give a folder a list of clock times (e.g. 04:00, 12:00, 16:00) and it will only do its periodic full rescan at those times each day. It doesn’t touch “Watch for Changes” at all — that keeps working exactly as before.

My concrete use case: a video production workload with very large files (hundreds of GB to low TB per folder), where Syncthing is used as the backup/sync layer for the footage archive. During working hours the connection is needed for other things, so a folder that’s constantly watching and periodically doing full rescans of that much data competes for bandwidth exactly when it’s least wanted. With this feature I can confine that activity to specific off-peak hours (e.g. overnight) instead of it running on a fixed interval all day long.

Code + a short write-up of the changes (config, model scheduler, GUI field) is here, as a compare against main:

It’s built on top of v2.1.6-rc.3 (2 commits on top, nothing else changed), has unit tests for the scheduling logic, and I’ve had it running on a real production instance for the last couple of days (two sendonly folders, ~50k files combined) — both folders have triggered their scheduled scan exactly on time each night, with zero errors.

I tried to open a pull request the normal way, but I’m getting: “An owner of this repository has limited the ability to open a pull request to users that are collaborators on this repository.” I understand that’s very likely there to deal with low-effort/AI-spam PRs, which is completely reasonable — just wanted to flag it here in case there’s a preferred way to get this in front of a maintainer in the meantime, or a rough idea of when that limit might lift.

Happy to adjust anything about the approach — naming, whether it should interact with the rescan interval differently, etc. Thanks for looking!

1 Like

Great idea!

1 Like

Thanks for taking the time to contribute this feature!

I haven’t looked at the code and can’t give you an estimate on whether it will be considered for merging. That largely depends on the complexity and maintenance burden it carries into the code base.

But I want to point out that the use case itself can also be covered with the current version by exercising the REST API. You can simply disable regular scans and watching for changes in the folder configuration. Then you make one small API request to the same effect of pressing the per-folder “Rescan” button in the GUI. That is very easy to automate using your favorite task scheduling solution the operating system offers.

See here for the API call documentation: POST /rest/db/scan — Syncthing documentation

2 Likes