Content update without clicks

Hi, it’s my first post, so excuse my novelty.
I have a NextCloud installation through Docker, in Open Media Vault. With the help of “external sources”, I have pointed to a smb folder, and so far so good. The problem is that, until no one enters through the web interface, the changes are not applied. That is, if I create a folder in the smb resource, NextCloud desktop clients do not reflect the change until they enter the folder from the web. Is there a solution for this? Thank you!


Hola, es mi primer post, así que perdonen mi novedad.

Dispongo de una instalación de NextCloud mediante Docker, en Open Media Vault. Con la ayuda de “external sources”, he apuntado a una carpeta smb, y hasta aquí todo correcto. El problema es que, hasta que no entra nadie por la interfaz web, no se aplican los cambios. Es decir, si creo una carpeta en el recurso smb, los clientes de escritorio de NextCloud no reflejan el cambio hasta entrar a la carpeta desde la web. Existe alguna solución para esto? Gracias!

You can use the occ command line tool to scan the folder structure in the background, to make Nextcloud aware of the changes, like e.g.

./occ files:scan --path=<path-to-directory> ...

Hi, thank you very much for your reply. I have tried the solution, and the result is as follows:

occ $ files:scan --path=“username/smbfolder”
Starting scan for user 1 out of 1 (TicCodinas)
Path not found: /username/smbfolder
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+

I entered my username, and the name I assigned to the server’s shared folder, not the path to the folder. I hope you did well.

It tells me the folder doesn’t exist. Should I run the command with other data? And for it to run every X minutes?

Thank you very much and sorry for the inconvenience.


Hola, muchas gracias por tu respuesta. He probado la solución, y el resultado es el siguiente:

occ $ files:scan --path=“username/smbfolder”
Starting scan for user 1 out of 1 (TicCodinas)
Path not found: /username/smbfolder
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+

He introducido mi nombre de usuario, y el nombre que le asigné a la carpeta compartida del servidor, no la ruta a la carpeta. Espero que lo haya hecho bien.

Me indica que la carpeta no existe. Debo ejecutar el comando con otros datos? Y para que se ejecute cada X minutos?

Muchas gracias y disculpad las molestias.

Hi, I’m answering myself:

The route was badly written, must be:
user_name/files/folder_to_scan
So scan the contents.

But at this point I get another error, it seems that the SMB folder has some read-only files and gives me an error when scanning:

occ $ files:scan --path=“TicCodinas/files/Dades@Servidor-HP”
Starting scan for user 1 out of 1 (TicCodinas)Exception during scan: “files/f280452c45fe7d2dc8c6fcd886c40498” is locked#0 /config/www/nextcloud/lib/private/Files/Storage/Common.php(715): OC\Lock\DBLockingProvider->acquireLock(‘files/f280452c4…’, 2)#1 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Common->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#2 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#3 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#4 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#5 /config/www/nextcloud/lib/private/Files/Cache/Scanner.php(331): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#6 /config/www/nextcloud/lib/private/Files/Utils/Scanner.php(245): OC\Files\Cache\Scanner->scan(‘’, true, 3)#7 /config/www/nextcloud/apps/files/lib/Command/Scan.php(145): OC\Files\Utils\Scanner->scan(‘/TicCodinas/fil…’, true, NULL)#8 /config/www/nextcloud/apps/files/lib/Command/Scan.php(201): OCA\Files\Command\Scan->scanFiles(‘TicCodinas’, ‘/TicCodinas/fil…’, Object(OCA\OCCWeb\Controller\OccOutput), false, true, false)#9 /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#10 /config/www/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#11 /config/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#12 /config/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#13 /config/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#14 /config/www/nextcloud/apps/occweb/lib/Controller/OCCApplication.php(207): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#15 /config/www/nextcloud/apps/occweb/lib/Controller/OccController.php(61): OCA\OCCWeb\Controller\OCCApplication->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#16 /config/www/nextcloud/apps/occweb/lib/Controller/OccController.php(81): OCA\OCCWeb\Controller\OccController->run(Object(Symfony\Component\Console\Input\StringInput))#17 /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(166): OCA\OCCWeb\Controller\OccController->cmd(‘files:scan --pa…’)#18 /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(99): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\OCCWeb\Controller\OccController), ‘cmd’)#19 /config/www/nextcloud/lib/private/AppFramework/App.php(126): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\OCCWeb\Controller\OccController), ‘cmd’)#20 /config/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main(‘OCA\OCCWeb\Cont…’, ‘cmd’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)#21 [internal function: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)#22 /config/www/nextcloud/lib/private/Route/Router.php(297): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)#23 /config/www/nextcloud/lib/base.php(975): OC\Route\Router->match(‘/apps/occweb/cm…’)#24 /config/www/nextcloud/index.php(42): OC::handleRequest()#25 {main}]
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+

What could be happening?

Thank you very much!


Hola, estoy respondiendo yo mismo:

La ruta estaba mal escrita, debe ser:
nombre_de_usuario/ficheros/carpeta_a_escaneado
Así, si que escanea el contenido.

Pero en este punto obtengo otro error, parece que la carpeta SMB tiene algunos archivos de sólo lectura y me da un error al escanear:

occ $ files:scan --path=“TicCodinas/files/Dades@Servidor-HP”
Starting scan for user 1 out of 1 (TicCodinas)Exception during scan: “files/f280452c45fe7d2dc8c6fcd886c40498” is locked#0 /config/www/nextcloud/lib/private/Files/Storage/Common.php(715): OC\Lock\DBLockingProvider->acquireLock(‘files/f280452c4…’, 2)#1 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Common->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#2 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#3 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#4 /config/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#5 /config/www/nextcloud/lib/private/Files/Cache/Scanner.php(331): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))#6 /config/www/nextcloud/lib/private/Files/Utils/Scanner.php(245): OC\Files\Cache\Scanner->scan(‘’, true, 3)#7 /config/www/nextcloud/apps/files/lib/Command/Scan.php(145): OC\Files\Utils\Scanner->scan(‘/TicCodinas/fil…’, true, NULL)#8 /config/www/nextcloud/apps/files/lib/Command/Scan.php(201): OCA\Files\Command\Scan->scanFiles(‘TicCodinas’, ‘/TicCodinas/fil…’, Object(OCA\OCCWeb\Controller\OccOutput), false, true, false)#9 /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#10 /config/www/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#11 /config/www/nextcloud/3rdparty/symfony/console/Application.php(901): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#12 /config/www/nextcloud/3rdparty/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#13 /config/www/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#14 /config/www/nextcloud/apps/occweb/lib/Controller/OCCApplication.php(207): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#15 /config/www/nextcloud/apps/occweb/lib/Controller/OccController.php(61): OCA\OCCWeb\Controller\OCCApplication->run(Object(Symfony\Component\Console\Input\StringInput), Object(OCA\OCCWeb\Controller\OccOutput))#16 /config/www/nextcloud/apps/occweb/lib/Controller/OccController.php(81): OCA\OCCWeb\Controller\OccController->run(Object(Symfony\Component\Console\Input\StringInput))#17 /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(166): OCA\OCCWeb\Controller\OccController->cmd(‘files:scan --pa…’)#18 /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php(99): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\OCCWeb\Controller\OccController), ‘cmd’)#19 /config/www/nextcloud/lib/private/AppFramework/App.php(126): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\OCCWeb\Controller\OccController), ‘cmd’)#20 /config/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php(47): OC\AppFramework\App::main(‘OCA\OCCWeb\Cont…’, ‘cmd’, Object(OC\AppFramework\DependencyInjection\DIContainer), Array)#21 [internal function: OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)#22 /config/www/nextcloud/lib/private/Route/Router.php(297): call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)#23 /config/www/nextcloud/lib/base.php(975): OC\Route\Router->match(‘/apps/occweb/cm…’)#24 /config/www/nextcloud/index.php(42): OC::handleRequest()#25 {main}]
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+

¿Qué podría estar pasando?

Muchísimas gracias!