Nextcloud files:scan with Docker

I wrote article how i’m Hosting Nextcloud with Docker. I’m using Docker Swarm and it will effect paths i’m here using.
To add bulk of files into Nextcloud you need to first move files to Nextcloud volume and then tell Nextcloud to rescan all files.

Move new files into Nextcloud volume

sudo mv FILES /PATHTOdocker/volumes/cloud_nextcloud/_data/data/USER/files/
sudo chown --reference=/PATHTOdocker/volumes/cloud_nextcloud/_data/data/USER /PATHTOdocker/volumes/cloud_nextcloud/_data/data/USER/files/*
sudo chcon --reference=/PATHTOdocker/volumes/cloud_nextcloud/_data/data/USER /PATHTOdocker/volumes/cloud_nextcloud/_data/data/USER/files/*

Scan new files

sudo docker exec --user www-data $(docker ps -q -f name=cloud_cloud) php occ files:scan --all

to scan only one users files change –all to USER

#sudo docker exec --user www-data $(docker ps -q -f name=cloud_cloud) php occ files:scan USER

https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/occ_command.html#file-operations

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.