gas85
June 3, 2019, 8:24am
4
BruderB:
If a new file is created in nextclout/data/user/files (by hand or by running a script) on the NC server, it is not automatically being presented in NCβs webfrontend or to any dav-client. Imho, it needs to be registered in the database. So, how can that be done?
It is not recommended way of working with NC, but you need to run βscanβ command to rescan files under the path, or whole NC filesystem:
sudo -u www-data php occ files:scan --path="user_id/files/mount_name/path"
E.g.
sudo -u www-data php occ files:scan --path="/alice/files/Music"
β Doku: Using the occ command β Nextcloud 15 Administration Manual 15 documentation
My sgesstion is to added some local folder as Nextcloud external storage and work with your scripts direct there. Afterwards ether run rescan command, or do periodical external shares rescan. I wrote small script for a cron job, to do periodically external shares rescan. Will also generate small report in your logs:
#!/bin/bash
# By Georgiy Sitnikov.
#
# Will do external ONLY shares rescan for nextcloud and put execution information in NC log.
# If you would like to perform WHOLE nextcloud rescan, please add --all to command, e.g.:
# ./nextcloud-file-sync.sh --all
#
# AS-IS without any warranty
# Adjust to your NC installation
# Your NC OCC Command path
Command=/var/www/nextcloud/occ
# Your NC log file path
LogFile=/var/www/nextcloud/data/nextcloud.log
# Your log file path for other output if needed
CronLogFile=/var/log/next-cron.log
# If you want to perform cache cleanup, please change CACHE value to 1
CACHE=0
# Your PHP location
This file has been truncated. show original