External storage isn't up to date

External local storage isn’t up to date after using mv/ cp commands to move files and folders. Check for changes set to once every direct access.

What does check for changes once every direct access mean? Assuming this doesn’t mean when a user go into a folder or else wouldn’t be having issue. It is just check once upon new connection?

If the above is the case how does one force a rescan of an external storage medium say after using a mv or cp command on external storage?

Any other suggestions to keep external storage (especially “local” external storage, as prefer not to keep files in the Nextcloud data directory) up to date in Nextcloud when constantly moving files using the command line, rsync, etc?

Currently running occ files:scan --all. Will see if this resolves and if so will add to cron job.

Running occ files:scan --all resolved.

1 Like

I checked the documentation, in a previous version in states that it searches each time the file system is used (https://github.com/nextcloud/documentation/commit/37dd60ce69af644255a8a286b4ce02c8d2fab355). Now, what does “use” exactly mean? We also use caching to speed up these processes that it doesn’t have to be read every time…

@icewind @nickvergessen can you clarify this point?

@schnappi If you add an empty textfile to such a folder that has changed, does this refresh the file list?

@tflidd Yes. 99.9% of the time the file system refreshes itself with no problem especially with small operations. However more than once a large cp, mv, or rsync command does not result in a local folder connected via external storage refreshing itself.

Solution is just to run the scan command via cron every month or whatever time table works whenever one is managing Nextcloud external storage with tools other than Nexcloud.

External storage folders not refreshing.
Is there a fix for this?

Assuming one is using a Debian based server run this in the command line to fix the issue:

sudo -u www-data php /var/www/nextcloud-install-destination/occ files:scan --all

Perhaps you should create a bug report, here in the forum such issues are getting lost. I’m not sure if it is supposed to use the occ-scan, but anyway it then should be clarified in the documentation.

Am not sure this is a bug. In their documentation they recommend using the above command at regular intervals (they throw out 15 minutes) via cron job when using external storage. That being said 15 minutes is too often. The scan seems a little resource heavy. Maybe once a day in most circumstances.

Look at the bottom of the documentation here:

https://docs.nextcloud.com/server/12/admin_manual/configuration_files/external_storage_configuration_gui.html

Then that’s the way to go. If once a day is enough for you, that’s fine.

Hi,

Same issue for me.
Fresh install (Ubuntu 18.04, NC 18.04).
External Storage not refreshing. Was also thinking that “once every direct access” would do the refresh each time a user open the folder.

This would be very nice.

In the meantime, I will do a cron job. But it takes a while to execute :wink:

Same here, debian 10, nc 18.04. We are running the cron job (occ files:scan --all) and it processes all users, yet still the external storages (smb/cifs/smbclient in our case, using the users credentials, saved in session) is NOT updating.
Even though we have also set filesystem_check_changes = 1, and configured the external storage to ‘refresh upon every direct access’.

I don’t think occ files:scan --all is working for us, as in the cifs/smb/smbclient case, connection is unique, everytime, using the current users credentials. We would like to completely disable any caching.

Currently, we have to create a new file in the storage, and that makes all files suddenly appear.

So for us, this seems much like a bug…

In this case, you should open a bug report…

So… I did. Here: https://github.com/nextcloud/server/issues/20898

1 Like