Koozali.org: home of the SME Server

NextCloud qustion

Offline calisun

  • *
  • 601
  • +0/-0
NextCloud qustion
« 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.
« Last Edit: September 16, 2019, 04:56:53 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: NextCloud qustion
« Reply #1 on: September 16, 2019, 05:40:43 AM »
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.

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: NextCloud qustion
« Reply #2 on: September 17, 2019, 12:25:43 AM »
Nextcloud unfortunately does not explore the external file system unless we ask for and only check its mysql snapshot.


Here is the simple command

Code: [Select]
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 !!!

Offline calisun

  • *
  • 601
  • +0/-0
Re: NextCloud qustion
« Reply #3 on: September 20, 2019, 11:38:33 PM »
Not sure why it is not working for me:

SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline calisun

  • *
  • 601
  • +0/-0
Re: NextCloud qustion
« Reply #4 on: September 20, 2019, 11:51:59 PM »
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.

SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline calisun

  • *
  • 601
  • +0/-0
Re: NextCloud qustion
« Reply #5 on: September 21, 2019, 12:11:05 AM »
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.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: NextCloud qustion
« Reply #6 on: September 21, 2019, 03:19:37 AM »
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.

Offline calisun

  • *
  • 601
  • +0/-0
Re: NextCloud qustion
« Reply #7 on: September 21, 2019, 03:48:32 AM »
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. 
« Last Edit: September 21, 2019, 05:53:10 AM by calisun »
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: NextCloud qustion
« Reply #8 on: September 21, 2019, 11:19:33 AM »
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




Offline calisun

  • *
  • 601
  • +0/-0
Re: NextCloud qustion
« Reply #9 on: October 16, 2019, 01:29:00 AM »
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.
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: NextCloud qustion
« Reply #10 on: October 16, 2019, 05:38:47 PM »
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

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: NextCloud qustion
« Reply #11 on: October 16, 2019, 05:41:08 PM »
On sme9 smbclient is a version 3. So no chance to try the notification.

Offline calisun

  • *
  • 601
  • +0/-0
Re: NextCloud qustion
« Reply #12 on: September 14, 2020, 04:43:11 AM »
Just a quick update on how I was able to get it working as desired:
In folder:
Code: [Select]
/usr/share/nextcloud/configI edited:
Code: [Select]
config.phpby adding following command:
Code: [Select]
'filesystem_check_changes' => 1,
SME user and community member since 2005.
Want to install Wordpress in iBay of SME Server?
See my step-by-step How-To wiki here:
http://wiki.contribs.org/Wordpress_Multisite