Inotifywait not detecting file added to rclone mount

What is the problem you are having with rclone?

Hi! Sorry- don’t know if this is a problem with inotifywait or rclone, but only seems to happen on rclone mounts. When I add a file to an rclone mounted directory via the remote (i.e. using MS OneDrive/Google Drive iOS app to place a file in the folder), inotifywait doesn’t see it.

Running this in screen 1

$ inotifywait -m --format "%w%f - %e" rclone-test

And this in screen 2

cp onedrive-local-test rclone-test/ 

Results in this in screen 1

Setting up watches.
Watches established.
rclone-test/onedrive-local-test - CREATE
rclone-test/onedrive-local-test - OPEN
rclone-test/onedrive-local-test - CLOSE_WRITE,CLOSE

However, copying onedrive-remote-test into rclone-test using the OneDrive iOS app is not detected by inotifywait in screen 1. If I ls rclone-test in screen 2 I can see that the file has indeed arrived on the local system, and in screen 1 inotifywait has detected the ls activity, but not the remote file arriving into the folder

Setting up watches.
Watches established.
rclone-test/onedrive-local-test - CREATE
rclone-test/onedrive-local-test - OPEN
rclone-test/onedrive-local-test - CLOSE_WRITE,CLOSE
rclone-test/ - OPEN,ISDIR
rclone-test/ - ACCESS,ISDIR
rclone-test/ - ACCESS,ISDIR
rclone-test/ - CLOSE_NOWRITE,CLOSE,ISDIR

Run the command 'rclone version' and share the full output of the command.

rclone v1.57.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.11.0-1025-oracle (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Microsoft OneDrive, Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount --vfs-cache-mode writes --allow-other --allow-non-empty --daemon od:rclone-test rclone-test

&

rclone mount --vfs-cache-mode writes --allow-other --allow-non-empty --daemon od:rclone-test rclone-test

The rclone config contents with secrets removed.

[gd]
type = drive
client_id = apps.googleusercontent.com
client_secret = 
scope = drive
token = {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":""}
team_drive = 

[od]
type = onedrive
token = {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":""}
drive_id = 
drive_type = personal

A log from the command with the -vvv flag

I've tested this with Google Drive and it has in the same behavior, but I'm only giving OneDrive results here

2022/01/18 17:38:37 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "mount" "--vfs-cache-mode" "writes" "--allow-other" "--allow-non-empty" "--daemon" "od:rclone-test" "rclone-test" "--log-file" "debug-rclone-od" "-vvv"]
2022/01/18 17:38:37 DEBUG : Creating backend with remote "od:rclone-test"
2022/01/18 17:38:37 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2022/01/18 17:38:37 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "--vfs-cache-mode" "writes" "--allow-other" "--allow-non-empty" "--daemon" "od:rclone-test" "rclone-test" "--log-file" "debug-rclone-od" "-vvv"]
2022/01/18 17:38:37 DEBUG : Creating backend with remote "od:rclone-test"
2022/01/18 17:38:37 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2022/01/18 17:38:37 INFO  : One drive root 'rclone-test': poll-interval is not supported by this remote
2022/01/18 17:38:37 DEBUG : vfs cache: root is "/home/ubuntu/.cache/rclone"
2022/01/18 17:38:37 DEBUG : vfs cache: data root is "/home/ubuntu/.cache/rclone/vfs/od/rclone-test"
2022/01/18 17:38:37 DEBUG : vfs cache: metadata root is "/home/ubuntu/.cache/rclone/vfsMeta/od/rclone-test"
2022/01/18 17:38:37 DEBUG : Creating backend with remote "/home/ubuntu/.cache/rclone/vfs/od/rclone-test"
2022/01/18 17:38:37 DEBUG : Creating backend with remote "/home/ubuntu/.cache/rclone/vfsMeta/od/rclone-test"
2022/01/18 17:38:37 DEBUG : One drive root 'rclone-test': Mounting on "rclone-test"
2022/01/18 17:38:37 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:38:37 DEBUG : : Root: 
2022/01/18 17:38:37 DEBUG : : >Root: node=/, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Lookup: name=".Trash"
2022/01/18 17:38:37 DEBUG : rclone: Version "v1.57.0" finishing with parameters ["/usr/bin/rclone" "mount" "--vfs-cache-mode" "writes" "--allow-other" "--allow-non-empty" "--daemon" "od:rclone-test" "rclone-test" "--log-file" "debug-rclone-od" "-vvv"]
2022/01/18 17:38:37 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Lookup: name=".xdg-volume-info"
2022/01/18 17:38:37 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:38:37 DEBUG : /: Lookup: name="autorun.inf"
2022/01/18 17:38:37 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:38:37 DEBUG : /: Lookup: name=".Trash-1001"
2022/01/18 17:38:37 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Attr: 
2022/01/18 17:38:37 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:38:37 DEBUG : /: ReadDirAll: 
2022/01/18 17:38:37 DEBUG : /: >ReadDirAll: item=2, err=<nil>
2022/01/18 17:38:37 DEBUG : /: Lookup: name="autorun.inf"
2022/01/18 17:38:37 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:38:51 DEBUG : /: Attr: 
2022/01/18 17:38:51 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:39:04 DEBUG : /: Attr: 
2022/01/18 17:39:04 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:39:10 DEBUG : /: Attr: 
2022/01/18 17:39:10 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:39:27 DEBUG : /: Attr: 
2022/01/18 17:39:27 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:39:37 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:39:41 DEBUG : /: Attr: 
2022/01/18 17:39:41 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:39:41 DEBUG : /: Lookup: name="onedrive-local-test"
2022/01/18 17:39:41 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:39:41 DEBUG : /: Lookup: name="onedrive-local-test"
2022/01/18 17:39:41 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2022/01/18 17:39:41 DEBUG : /: Create: name="onedrive-local-test"
2022/01/18 17:39:41 DEBUG : onedrive-local-test: Open: flags=O_WRONLY|O_CREATE|O_EXCL
2022/01/18 17:39:41 DEBUG : onedrive-local-test: newRWFileHandle: 
2022/01/18 17:39:41 DEBUG : onedrive-local-test(0xc000515f40): openPending: 
2022/01/18 17:39:41 DEBUG : onedrive-local-test: vfs cache: truncate to size=0
2022/01/18 17:39:41 DEBUG : : Added virtual directory entry vAddFile: "onedrive-local-test"
2022/01/18 17:39:41 DEBUG : onedrive-local-test(0xc000515f40): >openPending: err=<nil>
2022/01/18 17:39:41 DEBUG : onedrive-local-test: >newRWFileHandle: err=<nil>
2022/01/18 17:39:41 DEBUG : : Added virtual directory entry vAddFile: "onedrive-local-test"
2022/01/18 17:39:41 DEBUG : onedrive-local-test: >Open: fd=onedrive-local-test (rw), err=<nil>
2022/01/18 17:39:41 DEBUG : /: >Create: node=onedrive-local-test, handle=&{onedrive-local-test (rw)}, err=<nil>
2022/01/18 17:39:41 DEBUG : onedrive-local-test: Attr: 
2022/01/18 17:39:41 DEBUG : onedrive-local-test: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2022/01/18 17:39:41 DEBUG : &{onedrive-local-test (rw)}: Flush: 
2022/01/18 17:39:41 DEBUG : onedrive-local-test(0xc000515f40): RWFileHandle.Flush
2022/01/18 17:39:41 DEBUG : &{onedrive-local-test (rw)}: >Flush: err=<nil>
2022/01/18 17:39:41 DEBUG : &{onedrive-local-test (rw)}: Release: 
2022/01/18 17:39:41 DEBUG : onedrive-local-test(0xc000515f40): RWFileHandle.Release
2022/01/18 17:39:41 DEBUG : onedrive-local-test(0xc000515f40): close: 
2022/01/18 17:39:41 DEBUG : onedrive-local-test: vfs cache: setting modification time to 2022-01-18 17:39:41.352549362 -0500 EST m=+63.897499901
2022/01/18 17:39:41 INFO  : onedrive-local-test: vfs cache: queuing for upload in 5s
2022/01/18 17:39:41 DEBUG : onedrive-local-test(0xc000515f40): >close: err=<nil>
2022/01/18 17:39:41 DEBUG : &{onedrive-local-test (rw)}: >Release: err=<nil>
2022/01/18 17:39:46 DEBUG : onedrive-local-test: vfs cache: starting upload
2022/01/18 17:39:46 DEBUG : onedrive-local-test: Starting singlepart upload
2022/01/18 17:39:46 DEBUG : onedrive-local-test: sha1 = da39a3ee5e6b4b0d3255bfef95601890afd80709 OK
2022/01/18 17:39:46 INFO  : onedrive-local-test: Copied (new)
2022/01/18 17:39:46 DEBUG : onedrive-local-test: vfs cache: fingerprint now "0,2022-01-18 22:39:41 +0000 UTC,da39a3ee5e6b4b0d3255bfef95601890afd80709"
2022/01/18 17:39:46 DEBUG : onedrive-local-test: vfs cache: writeback object to VFS layer
2022/01/18 17:39:46 DEBUG : : Added virtual directory entry vAddFile: "onedrive-local-test"
2022/01/18 17:39:46 INFO  : onedrive-local-test: vfs cache: upload succeeded try #1
2022/01/18 17:40:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:40:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:41:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:41:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:42:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:42:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:43:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:43:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:44:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:44:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:45:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:45:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:46:37 DEBUG : vfs cache RemoveNotInUse (maxAge=3600000000000, emptyOnly=false): item onedrive-local-test not removed, freed 0 bytes
2022/01/18 17:46:37 INFO  : vfs cache: cleaned: objects 1 (was 1) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/01/18 17:46:55 DEBUG : /: Attr: 
2022/01/18 17:46:55 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:46:56 DEBUG : /: Attr: 
2022/01/18 17:46:56 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:46:56 DEBUG : /: ReadDirAll: 
2022/01/18 17:46:56 DEBUG : : Re-reading directory (8m18.53063562s old)
2022/01/18 17:46:56 DEBUG : : Removed virtual directory entry vAddFile: "onedrive-local-test"
2022/01/18 17:46:56 DEBUG : /: >ReadDirAll: item=4, err=<nil>
2022/01/18 17:46:56 DEBUG : /: Lookup: name="onedrive-local-test"
2022/01/18 17:46:56 DEBUG : /: >Lookup: node=onedrive-local-test, err=<nil>
2022/01/18 17:46:56 DEBUG : onedrive-local-test: Attr: 
2022/01/18 17:46:56 DEBUG : onedrive-local-test: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2022/01/18 17:46:56 DEBUG : /: Lookup: name="onedrive-remote-test"
2022/01/18 17:46:56 DEBUG : /: >Lookup: node=onedrive-remote-test, err=<nil>
2022/01/18 17:46:56 DEBUG : onedrive-remote-test: Attr: 
2022/01/18 17:46:56 DEBUG : onedrive-remote-test: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-r--, err=<nil>
2022/01/18 17:47:30 DEBUG : /: Attr: 
2022/01/18 17:47:30 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=<nil>
2022/01/18 17:47:30 DEBUG : rclone-test: Unmounted externally. Just exit now.
2022/01/18 17:47:30 DEBUG : rclone: Version "v1.57.0" finishing with parameters ["/usr/bin/rclone" "mount" "--vfs-cache-mode" "writes" "--allow-other" "--allow-non-empty" "--daemon" "od:rclone-test" "rclone-test" "--log-file" "debug-rclone-od" "-vvv"]

hello and welcome to the forum,

if you copy a file direct to onedrive, not using the rclone mount
then, by default, there is a five minute delay before rclone will notice it.

https://rclone.org/commands/rclone_mount/#vfs-directory-cache
"changes made directly on the cloud storage by the web interface or a different copy of rclone will only be picked up once the directory cache expires"

and in the forum, there are number of posts about inotifywait, did none of those answer all your questions?

Hello and thanks!

I waited the 5 minutes as you can see in the log file, and I could locally see the file that was added remotely, so rclone noticed it, and made it available, however inotifywait does not see it.

I looked through all the inotifywait posts I could find on the forum, and didn't find a solution that worked for me.

ok, no worries, hopefully someone more knowledgeable than myself will stop by soon.

The short answer is that it doesn't work due to way that fuse interacts with the kernel since it's not a normal file system.

If items are added outside of the mount, the kernel doesn't send the 'right' notification so inotify doesn't pick it up.

If you copy locally, it does which I feel is semi recent as that didn't work before but I tested that ~1-2 months back with another person and it did work to my surprise.

I don't think it's anything rclone related to the best of my knowledge.

I hate to ping @ivandeex but he might be able to add in a bit more detail/confirm as he's more knowledgeable in the inner workings than I.

tl;dr FUSE does not support inotify yet. rclone can't do anything here.

Quick googling showed that inotify support was not present in libfuse sources in 2019. Given kernel release pipeline from the edge kernel pr approval to inclusion in major linux releases this convinced me that you will not see it in Linux/FUSE until the next 5.x. Also it is not yet present in golang fuse wrappers billziss/cgofuse or bazil/gofuse as of now.

2 Likes

Ah, thanks for the answers, all!

I was afraid it might be something like that.

I’m looking for a solution to watch an rclone mounted folder on the local machine and take actions based on files added, any suggestions?

Thanks for your time!

hi,
never used this command, but if the backend supports polling, this might work.
https://rclone.org/commands/rclone_test_changenotify/

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