Linux: inotify enabled but scanning still happening


(Bob Hepple) #1

I’ve enabled inotify (FS Watcher Enabled) - actually, it’s the default AFAICS - but syncthing is still scanning according to ‘fatrace’. It’s a bit annoying as I’d like to keep that particular disc in standby mode and syncthing is waking it up - I had expected syncthing to wait on notifications from inotify instead. Of course, I am certain that nothing else is accessing the disc - and fatrace points the finger at syncthing itself.

Am I barking up the wrong tree?

Details:

syncthing-0.14.50-1.fc28.x86_64 Fedora release 28 (Twenty Eight) Linux achar 4.18.7-100.fc27.x86_64 #1 SMP Thu Sep 13 18:41:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Output of ‘cd /mnt/home; fatrace -c’:

syncthing(1236): RO /mnt/home/bhepple/media/podcasts

syncthing(1236): RC /mnt/home/bhepple/media/podcasts

syncthing(1236): RCO /mnt/home/bhepple/media/podcasts/20180705

syncthing(1236): O /mnt/home/bhepple/media/podcasts/20180621

syncthing(1236): RC /mnt/home/bhepple/media/podcasts/20180621

syncthing(1236): O /mnt/home/bhepple/media/podcasts/20180712

syncthing(1236): RC /mnt/home/bhepple/media/podcasts/20180712

syncthing(1236): RO /mnt/home/bhepple/media/podcasts/20180726

syncthing(1236): RC /mnt/home/bhepple/media/podcasts/20180726

syncthing(1236): RO /mnt/home/bhepple/media/podcasts/20180628

syncthing(1236): C /mnt/home/bhepple/media/podcasts/20180628

syncthing(1236): RCO /mnt/home/bhepple/media/podcasts/20180719

syncthing(1236): O /mnt/home/bhepple/media/books/fiction

syncthing(1236): RC /mnt/home/bhepple/media/books/fiction

0 12:47 home/ $ ps -ef |grep 1236 bhepple 1236 1 0 Sep25 ? 00:09:44 /usr/bin/syncthing -no-browser -no-restart -logflags=0

… sorry about the formatting!


(Simon) #2

When is this happening? There is a scan on folder start, then there are still periodic scans every hour by default (you can disable that of course). You could also enable model debug logging to see what it is doing when you see activity with fatrace.


(Bob Hepple) #3

OK, I tried that and this is what I see. The local linux device is on 192.168.0.14

First of all, the output from fatrace:

16:47:42.578189 syncthing(1236): O /mnt/home/bhepple/media/books/fiction
16:47:42.578189 syncthing(1236): RC /mnt/home/bhepple/media/books/fiction
...

and the corresponding syncthing log:

2018-10-04 16:47:31 Connection to CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA at 192.168.0.14:46858-114.77.243.197:35449/tcp-client closed: read timeout
2018-10-04 16:47:31 Exiting sendIndexes for default to CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA at 192.168.0.14:46858-114.77.243.197:35449/tcp-client: <nil>
2018-10-04 16:47:31 Exiting sendIndexes for c38se-1ialb to CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA at 192.168.0.14:46858-114.77.243.197:35449/tcp-client: <nil>
2018-10-04 16:47:31 Exiting sendIndexes for sm-g900i_vx2k-photos to CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA at 192.168.0.14:46858-114.77.243.197:35449/tcp-client: <nil>
2018-10-04 16:47:42 sendreceive/660ay-5c6kb@0xc4200fd8c0 Scanning subdirectories
2018-10-04 16:47:45 sendreceive/660ay-5c6kb@0xc4200fd8c0 next rescan in 54m14.71722729s
2018-10-04 16:48:08 Established secure connection to CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA at 192.168.0.14:47300-114.77.243.197:35449/tcp-client (TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305)
2018-10-04 16:48:08 Device CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA client is "syncthing v0.14.49" named "SM-G900I" at 192.168.0.14:47300-114.77.243.197:35449/tcp-client
2018-10-04 16:48:08 Device CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA folder "Podcasts" (c38se-1ialb) is delta index compatible (mlv=278)
2018-10-04 16:48:08 Device CBVVZZ2-JWRPIMA-ZIIIMAC-PMF3YW3-QTK6WJN-ZPWFM6D-2OVJHOA-ERXWJQA folder "Default" (default) is delta index compatible (mlv=716)

I’ll continue to monitor if it rescans within the hour as you mentioned.


(Bob Hepple) #4

OK - it’s the one-hour scan (almost - actually 55 minutes). Here’s the next event from fatrace:

17:42:00.027823 syncthing(1236): RCO /mnt/home/bhepple/media/books/fiction

Is there any way to execute a hook command after the scan is finished?

Cheers

Bob