Nice Solution to integrate SAMBA and Nextcloud

I’ve documented a nice solution to integrate SAMBA with Nextcloud.

When a file is created/changed/deleted in the filesystem (e.g. over Samba) run Nextcloud file scanning for the parent directory efficently via inotify. Otherwise the updates would not be recognized by Nextcloud.

Kind Regards, Klemens


That’s nice work, I can see this being quite useful in some scenarios like a NAS where the scripts folder is persistent but other modifications are not.

An alternative solution by icewind1991, The files_notify_redis app along side the samba plugin samba_vfs_notify_redis

Thanks for pointing out these alternative solutions. Have you used them? It’s not really clear to me from the docs how they work or what they achieve exactly.

I’ve not used it in anger but my understanding is it’s a method to make external storage more performant in Nextcloud. Rather than relying on a slow files scan every so often or only updating as a user visits the folder, it will only scan the changed files in the background. This makes it more inviting to use external storage rather than simply mounting your Nextcloud data folder as a shared folder in SAMBA.

  • You push filesystem notifications to a Redis instance (either via samba_vfs_notify_redis or something else).
  • The Nextcloud app reads these changes from Redis
  • The background scanner runs over only the registered changed files into the local DB in the background.

I will note it’s a little different conceptually than what you’re solving as it’s not going to work on your main data folder.