Folders and filesystem_check_changes

I like to move my complete data to my nextcloud storage. I ran into some problems, especially with big files (Movies and software like iso images) that cause the database to be killed due to havy ram consumption.
So while I am extending RAM (another 8GB are orderd), I want to use a more suitable protocol to transfer the big files.

Most suitable in my case would be Samba. I managed to get it working that I can have a parallel read access with Samba on my nextcloud files (required some messing around with ACL)
Writing/adding was more complicated, but I got this by setting ‘filesystem_check_changes’ => 1.

But… while new files are added, new folders do not appear in the webinterface.
Is this “by design” or is this a bug?

The documentation is not clear about this…

‘filesystem_check_changes’ => 0,
Specifies how often the local filesystem (the Nextcloud data/ directory, and NFS mounts in data/) is checked for changes made outside Nextcloud. This does not apply to external storages.
0 -> Never check the filesystem for outside changes, provides a performance increase when it’s certain that no changes are made directly to the filesystem
1 -> Check each file or folder at most once per request, recommended for general use if outside changes might happen.

Any advice, also for alternative solutions for my problem/requirement is appreciated!

Thanks.

I have a similar situation as yours.

I have a home linux server for everyone and usually people access it via samba (now sshfs as I got rid of windows on every machine). I needed to mess around with ACLs too but I could manage to get it work with owncloud for one year. Every user had his home that could be accesses through sshfs OR samba OR owncloud.

Now I’m going to Nextcloud and I tried to do the same. I’m writing you becase I have one working home like before but the others are not working.

If I find a solution or the cause I’ll share it.

EDIT:

If you can, try this:

  1. setup all the ACLs and stuff as you need
  2. create a file/folder in the Nextcloud webinterface
  3. through ssh or locally (maybe samba too) rename that created file to something else
  4. go to the nextcloud webinterface and refresh it

I got my second home working after this. It seems we need to trigger a filesystem event of a known file, I don’t know as I don’t know yet how Nextcloud is implemented.

Please let me know if you got it working.

if changes to the external folder are not supported, why there is this variable?

‘filesystem_check_changes’ => 0,
Specifies how often the local filesystem (the Nextcloud data/ directory, and NFS mounts in data/) is checked for changes made outside Nextcloud. This does not apply to external storages.

I think that you could use some command from here
especially from this point.

I tried running
sudo -u www-data php occ files:scan
this detects new and changed files, but NOT new folders…

:frowning:

Try this for example:
sudo -u www-data php occ files:scan --all

no difference. a A folder created with ssh does not appear in nextcloud

Did you give right permissions to web-server’s user for working with this files before scanning by occ?

sudo chown www-data:www-data /route/to/your_data_directory/ -R (if you have ubuntu and apach, for example)

1 Like

doh

I added default ACLs so that “user_a” gets permisions for every newly created file and folder by www-data, and i configured samba with create user www-data, but i created the test-dir with root permissions.

Its working now, like a charm!

I give a short HowTo, how to access your nextcloud files with samba (read & write) for user called “Dani”

a) configure “‘filesystem_check_changes’ => 1,” in nextcloud’s config.php

b) unless you access you samba with www-data (what I do not recommend): grant access for (system&samba) user Dani by:
cd <nextcloud_data_dir>
setfacl -R -m u:Dani:rwx files/
setfacl -dm u:Dani:rwx files/

c) add this to your smb.conf
[Dani]
path = <nextcloud_data_dir>/Dani/files
browsable = yes
writable = yes
guest ok = no
read only = no
valid users = Dani
create mode = 660
directory mode = 770
force user = www-data
force group = www-data

2 Likes