Koozali.org: home of the SME Server
Obsolete Releases => SME 9.x Contribs => Topic started by: calisun on September 16, 2019, 04:54:52 AM
-
After connecting to Nextcloud, I am able to save files to the server from within web browser or within android app, and these files are also visible using SMB and FTP.
The problem is when I save files to the server using SMB or FTP (same user name used used for all: Nextcloud, SMB FTP), these files are not visible in Nextcloud in a browser or in Android app.
-
You need to run occ files:scan <user id> to get the new files added to the nextcloud index. You need to run occ as the web server user, and you may need to specify the correct php executable. That is, running "occ" on a SME may look like this:
sudo -u www php73 /path/to/nextcloud/occ files:scan /relative/path/to/data
More info: https://docs.nextcloud.com/server/16/admin_manual/configuration_server/occ_command.html#file-operations-label
Alternatively, upload the files using a nextcloud webdav address, or load them using a desktop client - either of these will update the indexes without any extra steps required.
-
Nextcloud unfortunately does not explore the external file system unless we ask for and only check its mysql snapshot.
Here is the simple command
OCC files:scan /relative/path/to/data
OCC is an alias created with the contrib run the command with the right php version and right user
Note the upper case !!!
-
Not sure why it is not working for me:
-
At first I thought it is not working because I was trying to scan specific user folder, so I tried i-Bay folders. First I tried just root folder of all i-Bays and later specific i-Bay, and none worked.
-
At first I was looking at Jean-Philippe Pialasse command suggestion, but I noticed that mmccarn command includes some additional code to the command.
I must say that if the server is in a mixed environment that internal users use SMB and external users use NextCloud, NextCloud solution is useless.
I guess back to drawing board to look for a different solution.
-
My command is to avoid to write all the additional information that mccarn showed.
This is an alias.
Your issue is you try to scan folders outside of nextcloud root which is in
/home/e-smith/files/nextcloud
Then you need to find your users nextcloud id to find the right folder and then take the full path up to the ibay or home folder folder inside this path.
Ibay and home folder are virtually mounted inside the nextcloud user folder.
-
Thanks Jean-Philippe Pialasse,
Help me understand, this command, will it scan files one time or will it do it continuously?
If it is a one time thing, it is useless since my server is in a mixed environment: (internal users SMB/ External NextCloud) so I would have to run this command several times a day, which is not feasible.
Our plan was to add NextCloud to allow secure access for external users to files on server. It seemed like a ideal solution since NextCloud has mobile app, which allows external users to get to files quickly. But the file syncing issue has thrown a roadblock to our plans.
-
This is a one time thing you need to run several time.
The thing is, nextcloud is a cloud service.
You have to use it as a cloud service even on your desktop.
https://nextcloud.com/clients/
Then this not a mixed env anymore
-
Looks like there is a way for NextCloud to scan SMB shares automatically: https://docs.nextcloud.com/server/15/admin_manual/configuration_files/external_storage/smb.html
I will dig around to see if I can figure this out.
-
The issue to scan is that contrary to what nextcloud doc says relative path do not work.
You need to use a nextcloud user full path.
Further more nextcloud has no idea of the full path of an ibay. It even does not inow that it is on the same server. It only knows your ibay as ibayname trough smb server.
So full path to ibay will not work, full path to sme user home will not work.
You have to use :
/home/e-smith/files/nextclouds/user-ldap-uuid/files/ibays/ibayname
-
On sme9 smbclient is a version 3. So no chance to try the notification.
-
Just a quick update on how I was able to get it working as desired:
In folder:
/usr/share/nextcloud/config
I edited:
config.php
by adding following command:
'filesystem_check_changes' => 1,