Adding files to external drive via Samba or Other PCs. Nextcloud doesnt see those files


I hope its a simple problem, that I just cant find the right solution.

Problem in one sentence:
If i create or copy files into folder “Team” not via Nextcloud Ui, but with Samba, VPN or remove external drive (where “Team” folder is) and add files with another PC, a Nextcloud user who has permission to do anything in “Team” folder should see the new files/folders when drive is plugged back to the server. Is that possible?

We got a new external SSD, which we bring with us to our meetings, but otherwise its plugged back into the Nextcloud server via USB.

I think its an ownership problem. Whats the proper fix for this?

Files/folders made in the Nextcloud UI is owned by www-data.
Files/folders made outside Nextcloud are owned by samba users or root (root is probably because we add files in other WIndows PCs)

Files/folders owned by www-data, samba users , root does show up in Nextcloud webui, but not all of them.

Thanks in advance!

try running occ scan (look at manual for correct usage) and then they should appear.

perhaps putting this commandline into a cronjob would help doing it automated. am just guessing.
and am in a hurry. sorry for being short

Thanks for the reply!

I tried sudo -u www-data php occ files:scan --all but nothing
If i chown www-data:www-data the problematic folders/files, it does show up instantly in nextcloud UI.

The problem with this, then we can only access it those files in the NC webui, not with other samba users.
Being able to to both is even possible? (ownership wise)


this seems to be a more linux-related problem. i’d try and put smb-users into group “www-data” - or change group-permissions in a way that smb-users would be able to use/see it. but don’t ask me for security considerations. i can’t tell you, i’m afraid

Consider it solved :slight_smile:

1 Like