OCC - files:scan


#1

Hi,

Changed the data directory of my owncloud instance to:

‘datadirectory’ => ‘/opt/ocdata/’,

Then copied folders of data to /opt/ocdata/myuser/files/

Ran sudo -u www-data /var/www/owncloud/occ files:scan --path=“myuser/files”

Runs ok, but it’s scanning the old folder in the wrong path. It’s scanning this:

/var/www/owncloud/data/myuser/files

What is the correct way to get occ files:scan to scan the new data directory?

OwnCloud version is 10.0.10.4
Edition is community
OS is Ubuntu 18 server
php 7.2.10

Thanks

Luis


Owncloud 10.0.1 realpath(): open_basedir restriction in effect. File(\/)
#2

https://doc.owncloud.org/server/10.0/admin_manual/maintenance/manually-moving-data-folders.html


#3

interesting!

so, based on this I can create a symlink and not have to modify any database or config.php?

If so, I will replace

‘datadirectory’ => ‘/opt/ocdata/’,

with

‘datadirectory’ => ‘/var/www/owncloud/data/’,

not sure why there would be an option to set a datadirectory in the config if it isn’t going to be respected

¯_(ツ)_/¯

Thanks!


#4

Hey,

i think as long as your PHP setup is allowing to follow symlinks then this should work.

From what i know it is respected once during the installation and currently can’t be changed without additional modifications within the database like described in the posted link.


#5

Ok, so here is where I am with this:

  • yes, editing the config.php file will allow you to use a different folder as the data folder for owncloud (restart apache)
  • some things to be aware of when moving files into this folder (also outlined in some of the resource links provided by alfredb
  • symlinks are not needed
  • how you copy/move the files into the folder is important. depending on the way you move/copy the files you may miss moving/copying some hidden files
  • you have to chown the folder/files recursively to www-data
  • you also have to rescan the folder(s) so owncloud picks up the changes:

sudo -u www-data php /var/www/owncloud/occ files:scan --all


#6

Yes, we all (ok ,most of us) know that. So what?


#7

Perhaps you should spend more time providing useful comments and less time sharing your inarticulate and vapid thoughts.


#8

Yes, maybe you’re right.