You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow skipping Full Rescan on startup if Interval has not yet been exceeded. #5353
I've setup a very long Full Rescan Interval for my folders but when I restart Syncthing, all folders are scanned even when they have already been scanned within this interval. If this is intentional, please add a setting to disable this.
Background: I am running Syncthing on a slow Raspberry Pi. Full Rescans consume 100% CPU, RAM and I/O, which makes the WebUI (and SSH) almost impossible to use. I am trying to avoid them by setting a very large interval but when I restart Syncthing, I basically cannot use the WebUI for a few hours because of all the unwanted rescans taking place.
Version Information
Syncthing Version: v0.14.54, Linux (ARM)
OS Version: Linux 4.14.69+ on Raspberry Pi
Browser Version: n/a
Reacted by Deutrino, Florian R. Hölzlwimmer, rEnr3n, Marco Martinelli, Nicholas Sherlock, Jakob Borg, Adam Piggott, tzontron, Sir106, jtagcat and 24 more
For the other part of your issue, I am not familiar with that part of the code, but I suspect the initial scan can not be avoided, because Syncthing does not know if your files have been modified when it was not running.
Thanks, that suggestion sounds like it should solve some of my problems but might make the WebUI sluggish as it will also be throttled down... so, I'll give it a try to see how well it works.
Wrt. not knowning if a rescan is needed: in that case this bug would be a feature request for Syncthing to store a timestamp for the last scan on disk and read that at startup to avoid a rescan when none is needed.
Doing a scan at startup to kick off the schedule is intentional. With the default setting the difference isn't relevant. However in cases like yours where rescans should happen about once a day, I can see how rescanning everything on startup might be annoying. We could fix that, probably.
changed the title [-]Full Rescan Interval not applied on startup[/-][+]Allow skipping Full Rescan on startup if Interval has not yet been exceeded.[/+]on Dec 7, 2018
Wrt. not knowning if a rescan is needed: in that case this bug would be a feature request for Syncthing to store a timestamp for the last scan on disk and read that at startup to avoid a rescan when none is needed.
How would you handle the case where the local files have been modified when the service (and the inotify watch) is not running?
Thanks, that suggestion sounds like it should solve some of my problems but might make the WebUI sluggish as it will also be throttled down...
If the scan is currently CPU bound, yes it is likely to slow down the web UI too. However if it is IO bound, it should remain reactive, only the background scan may take longer to run.
I think this could only apply in the case where filesystem notifications are disabled. If we are running with notifications we need the initial scan to have a baseline for notifications.
If we are running without notifications and have a rescan interval of an hour, it doesn't hurt to wait half an hour or whatever remains of the rescan interval on restart.
How would you handle the case where the local files have been modified when the service (and the inotify watch) is not running?
Syncthing would now know about it until it did a full re-scan less than a day later. But this is not different from running Syncthing with "Watch for changes" disabled, so I do not see a problem with that (unless I am missing something).
If we are running without notifications and have a rescan interval of an hour, it doesn't hurt to wait half an hour or whatever remains of the rescan interval on restart.
Indeed; in my case it is a day but I do not care if my backup is out of sync for a day.
Sorry if this has already been answered elsewhere, but on Linux when inotify is used (the default), why is a periodic rescan even needed?
If Syncthing first setups the inotify watches, and then does the initial scan (in that order to avoid races), why isn't that sufficient to be immediately notified of all futures filesystem changes?
I use inotify on another projet an I am interested in its limitations. I have only found some on FUSE filesystems.
If you are refering th the /proc/sys/fs/inotify/max_* overflow, then syncthing knows when it hits that limit, and could then fallback to heavyweight "full rescan to poll changes" approach (with a big fat warning to inform users that bumping the limit will improve performance).
Question to syncthing developers: would you merge this feature if somebody implemented it / e.g. looking for contributors who implement it? Or is this something you wouldn't merge anyway?
Please allow this feature. The rescan on startup for large folders is incredible draining on the battery of laptops. And it's not useful: on a non-multi-boot system the files will not have changed between shutdown and the next boot. A periodic rescan occasionally is more than enough. Suggestion: something like "rescan after X days have elapsed (configurable) along with a checkbox [X] only when on mains power".
Question to syncthing developers: would you merge this feature if somebody implemented it / e.g. looking for contributors who implement it? Or is this something you wouldn't merge anyway?
I guess this comment from @calmh can be interpreted so that the answer to your last question is "yes":
The latest news, as of 12 seconds ago, is that we're not aware of anyone working on this. That could change at any time!
And after briefly scrolling though the comments I also haven't read a clear "no" from the Syncthing devs who participated in the conversation.
And it's not useful: on a non-multi-boot system the files will not have changed between shutdown and the next boot.
Files might have changed in the time window when Syncthing was not running. However, I agree that when keeping this time window low and when doing periodic rescans anyway than most people can probably live without a rescan on startup so it at least shouldn't be forced.
By the way, the usefulness of this feature came also up in Martchus/syncthingtray#392 which is about dealing with metered network connections. One reason that speaks against completely stopping Syncthing when the network connection is metered are these forced rescans on startup. For many folders on my phone even manual rescans are good enough as they are mostly used as receive-only folders.
This (and being able to schedule syncs for specific times, not just intervals) would be amazing. I have a NAS where I can't set CPU or container priorities and where Syncthing completely swamps my CPU at random, and restarting it only makes the problem worse because it then goes and rescans everything...
Similar problem here. Would ask to allow "Rescan on logon (once per XX hours at maximum)" like for example ESET Task Scheduler has "Run the task only once within the specified interval"
If this hopefully gets implemented, I'd like to add that it would make a lot of sense to be a per-folder setting and not a global one. Small folders that see constant changes would better be re-scanned on startup, while larger less-active ones wouldn't.
Reacted by Michael Mussato, Martchus, nvsystems, Gabe Cook, Adi Rabinovich and Viktor S
I want to test it for a few days and I'll be ready to submit a PR for that.
I'm wondering what is the correct procedure to be able to submit a PR.
First of all I should be assigned with this issue I believe?
Thank you so much @altring ! The only other way I can think of without changing the code myself is to run syncthing in a virtual machine so it can be suspended and resumed.
29. I want to test it for a few days and I'll be ready to submit a PR for that.
Sounds great, so thanks for looking into this. Have you made any progress?
31. The only other way I can think of without changing the code myself is to run syncthing in a virtual machine so it can be suspended and resumed.
If you're on Linux you, can send SIGSTOP/SIGCONT. This probably works for Syncthing, although you probably want to use a process group to ensure both, the main and monitoring process are covered.
Sounds great, so thanks for looking into this. Have you made any progress?
Yes, I tested it very good both on ASUS AX3000V2 router and on Windows 11 and the functionality itself works perfectly as expected.
The only important thing for folks who want to run syncthing on a router with SSD attached: you will need to have swap file deployed and swapiness configured in your router.
Without this syncthing will consume all remaining memory even with GOMEMLIMIT set. On large chunks of data indexing will choke the router.
Here is the settings in my post-mount file that make syncthing and router run pretty smothly and stable:
Activity
desbma commentedon Dec 7, 2018
Maybe you can improve that by lowering the CPU and IO priority, or even better use a different scheduler.
For example if you use the
syncthing@service, with asyncthinguser:For the other part of your issue, I am not familiar with that part of the code, but I suspect the initial scan can not be avoided, because Syncthing does not know if your files have been modified when it was not running.
SkyLined commentedon Dec 7, 2018
Thanks, that suggestion sounds like it should solve some of my problems but might make the WebUI sluggish as it will also be throttled down... so, I'll give it a try to see how well it works.
Wrt. not knowning if a rescan is needed: in that case this bug would be a feature request for Syncthing to store a timestamp for the last scan on disk and read that at startup to avoid a rescan when none is needed.
calmh commentedon Dec 7, 2018
Doing a scan at startup to kick off the schedule is intentional. With the default setting the difference isn't relevant. However in cases like yours where rescans should happen about once a day, I can see how rescanning everything on startup might be annoying. We could fix that, probably.
[-]Full Rescan Interval not applied on startup[/-][+]Allow skipping Full Rescan on startup if Interval has not yet been exceeded.[/+]SkyLined commentedon Dec 7, 2018
Fair enough, make this a feature request then :)
desbma commentedon Dec 7, 2018
How would you handle the case where the local files have been modified when the service (and the inotify watch) is not running?
desbma commentedon Dec 7, 2018
If the scan is currently CPU bound, yes it is likely to slow down the web UI too. However if it is IO bound, it should remain reactive, only the background scan may take longer to run.
calmh commentedon Dec 7, 2018
I think this could only apply in the case where filesystem notifications are disabled. If we are running with notifications we need the initial scan to have a baseline for notifications.
If we are running without notifications and have a rescan interval of an hour, it doesn't hurt to wait half an hour or whatever remains of the rescan interval on restart.
SkyLined commentedon Dec 7, 2018
Syncthing would now know about it until it did a full re-scan less than a day later. But this is not different from running Syncthing with "Watch for changes" disabled, so I do not see a problem with that (unless I am missing something).
SkyLined commentedon Dec 7, 2018
Indeed; in my case it is a day but I do not care if my backup is out of sync for a day.
AudriusButkevicius commentedon Dec 7, 2018
I recall there were other reasons to run a scan. Mostly to prime caches todo with completion, but perhaps these days this is not important anymore.
desbma commentedon Dec 7, 2018
Sorry if this has already been answered elsewhere, but on Linux when inotify is used (the default), why is a periodic rescan even needed?
If Syncthing first setups the inotify watches, and then does the initial scan (in that order to avoid races), why isn't that sufficient to be immediately notified of all futures filesystem changes?
EDIT: The doc says :
But does not explain how changes can be missed.
calmh commentedon Dec 8, 2018
Not all types of changes generate events, and events may be dropped due to overflow.
desbma commentedon Dec 8, 2018
Care to elaborate?
I use inotify on another projet an I am interested in its limitations. I have only found some on FUSE filesystems.
If you are refering th the
/proc/sys/fs/inotify/max_*overflow, thensyncthingknows when it hits that limit, and could then fallback to heavyweight "full rescan to poll changes" approach (with a big fat warning to inform users that bumping the limit will improve performance).21 remaining items
Hoeze commentedon Feb 18, 2025
Is there a way to keep syncthing running and listen for file system changes but only distribute them once I am back on WiFi?
isoos commentedon Nov 17, 2025
Question to syncthing developers: would you merge this feature if somebody implemented it / e.g. looking for contributors who implement it? Or is this something you wouldn't merge anyway?
nvsystems commentedon Dec 19, 2025
Please allow this feature. The rescan on startup for large folders is incredible draining on the battery of laptops. And it's not useful: on a non-multi-boot system the files will not have changed between shutdown and the next boot. A periodic rescan occasionally is more than enough. Suggestion: something like "rescan after X days have elapsed (configurable) along with a checkbox [X] only when on mains power".
Martchus commentedon Dec 19, 2025
I guess this comment from @calmh can be interpreted so that the answer to your last question is "yes":
And after briefly scrolling though the comments I also haven't read a clear "no" from the Syncthing devs who participated in the conversation.
Files might have changed in the time window when Syncthing was not running. However, I agree that when keeping this time window low and when doing periodic rescans anyway than most people can probably live without a rescan on startup so it at least shouldn't be forced.
By the way, the usefulness of this feature came also up in Martchus/syncthingtray#392 which is about dealing with metered network connections. One reason that speaks against completely stopping Syncthing when the network connection is metered are these forced rescans on startup. For many folders on my phone even manual rescans are good enough as they are mostly used as receive-only folders.
rcarmo commentedon Jan 6, 2026
This (and being able to schedule syncs for specific times, not just intervals) would be amazing. I have a NAS where I can't set CPU or container priorities and where Syncthing completely swamps my CPU at random, and restarting it only makes the problem worse because it then goes and rescans everything...
falcon4fun commentedon Apr 21, 2026
Similar problem here. Would ask to allow "Rescan on logon (once per XX hours at maximum)" like for example ESET Task Scheduler has "Run the task only once within the specified interval"
milroneth commentedon Aug 4, 2026
If this hopefully gets implemented, I'd like to add that it would make a lot of sense to be a per-folder setting and not a global one. Small folders that see constant changes would better be re-scanned on startup, while larger less-active ones wouldn't.
altring commentedon Oct 6, 2026
I've successfully implemented this feature and currently testing it on Windows 11 x64:
altring commentedon Oct 6, 2026
Also on my Asus router on armv7sf
It starts with DB migration first of all as the latest available Entware version is 2.0.15
altring commentedon Oct 6, 2026
I want to test it for a few days and I'll be ready to submit a PR for that.
I'm wondering what is the correct procedure to be able to submit a PR.
First of all I should be assigned with this issue I believe?
tomasz1986 commentedon Oct 6, 2026
Please check https://github.com/syncthing/syncthing/blob/main/CONTRIBUTING.md#contributing-code.
jms19 commentedon Oct 13, 2026
Thank you so much @altring ! The only other way I can think of without changing the code myself is to run syncthing in a virtual machine so it can be suspended and resumed.
Martchus commentedon Oct 13, 2026
Sounds great, so thanks for looking into this. Have you made any progress?
If you're on Linux you, can send
SIGSTOP/SIGCONT. This probably works for Syncthing, although you probably want to use a process group to ensure both, the main and monitoring process are covered.altring commentedon Oct 21, 2026
Yes, I tested it very good both on ASUS AX3000V2 router and on Windows 11 and the functionality itself works perfectly as expected.
The only important thing for folks who want to run syncthing on a router with SSD attached: you will need to have swap file deployed and swapiness configured in your router.
Without this syncthing will consume all remaining memory even with GOMEMLIMIT set. On large chunks of data indexing will choke the router.
Here is the settings in my post-mount file that make syncthing and router run pretty smothly and stable:
With swap you can set the latter to even high value.