Scan Group Directory with occ command

Hi,

I was just wondering if it was possible to scan a group folder with the OCC command.

I have a lot of ripped DVDs that I would like to add to a group folder. I have copied it to the appropriate folder .../data/__groupfolders/1/.... Unfortunately, I can’t seem to make NextCloud see the new files.

Any ideas?

It turns out that running

occ files:scan --all

had the desired effect. It would still be helpful to know if it is possible to just scan a group folder

I would also be interested to know if there is a way to scan just a specific groupfolder. Running occ files:scan --path=__groupfolder/2 doesn’t work.

as you can read here https://github.com/nextcloud/groupfolders/issues/46 you should be able to scan a group folder via

any user that has access to the folder

meaning you can do it with the following command:
sudo -u www-data php occ files:scan --path=/user/files/my_groupfolder_path

1 Like

that works
thanks

Update on this topic:
Faced the same question recently myself and discovered that there are (now?) special occ commands for group folders available. The one relevant here is occ groupfolders:scan <id>, where <id> is the number of the group folder, in the mentioned case “2”.
The solution using the name of the mounted folder inside a user’s filesystem is still valid, though.

2 Likes

I know this is getting dated… but I’m running 15.0.0 and wonder if there is a way to scan ALL groupfolders without calling out the individual numbers. It seems there is no “-all” flag for groupfolder:scan as there is for files:scan.
I guess I’m going to have to script something… ugh.

Not sure if I should continue this thread or start a new one (sorry, I’m new here). My issue is somewhat related in that when I do a scan -- all it appears to scan the group folders for each users, so it scans them many times, which is very time consuming on my system which has a lot of files. Is there any way to avoid this? Thanks.

the following thread solved the problem for me:

cheers.