OCC rescan not working

I added a folder through ftp. After that i runned this in ssh:
sudo -u www-data php /var/www/html/nextcloud/occ files:scan --path=“admin/files/Swooth”

But the error they give:
Unknown user 1 “admin

How to fix?

Scan all

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

Check and post the paths in your data-directory e.g. /var/www/html/nextcloud/data

But the problem is, scan all takes ages. I only need to “add” rescan a new folder
my data is posted here: /home/files/admin/files

Test other paths like

Unknown user 1 “admin”

Is there a directory?
ls -l /var/www/html/nextcloud/data/admin

ls -l /var/www/html/nextcloud/data

Noo, my data is stored on another disk mounted at /home/

this one exists: ls -l /var/www/html/nextcloud/data

Normally you set in config/config.php the data-path and there are the users.
I think “–path” is relative to the data-dir.

but in config.php we changed this: ‘datadirectory’ => ‘/home/files/’,

Ok. And in /home/files is a user/dir “admin”?

Yes this exists: /home/files/admin

Please post the entry with the path from your /var/www/html/nextcloud/config/config.php

Perhaps you have changed the path and not rescan all.

Can you find in your nextcloud-gui other files from /home/files/admin/… ?

I see all files in nextcloud, i justed add a folder from FTP.

The new folder is 200GB i did this: sudo -u www-data php /var/www/html/nextcloud/occ files:scan --all

but CPU was 100% and server wasn’t responding anymore. I see the folder in Nextcloud but as soon i want to open a file the cpu goes to 100%. and all file sizes are pending

Yes. You must can “–all” for all files. Why “–path” not works i do not know it.
Next time you better upload 50 GB, scan, 50 GB, scan, …

How long will it take you think to run the -all?

No idea. But 100% CPU is perhaps normal. Wait a few minutes or more.
Do not use the system if possible for other jobs.

Okay i will do it started now:

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

Starting scan for user 1 out of 1 (admin)

Ok. Send a message if finished.
You can look with top or htop for acutal jobs, cpu, caching, …
The system must insert all files in the database (e.g. MariaDB).

Lol it finished! and now pending is gone! But when i try to open a image the CPU is going to 100% how many cpu would you advice?

no idea. Normally it is no problem. Do you use all optimations? Perhaps it is a temporary problem. Also it could be a problem with creating thumbnails first time showing the images.

You can open a new thread. Please post cpu usage, top, htop, cache, version, …