Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

occ groupfolders:scan : scan only a specific folder like occ files:scan --path #1168

Closed
flowzen1337 opened this issue Dec 4, 2020 · 8 comments · Fixed by #2232
Closed

occ groupfolders:scan : scan only a specific folder like occ files:scan --path #1168

flowzen1337 opened this issue Dec 4, 2020 · 8 comments · Fixed by #2232
Labels
0. Needs triage Issues that need to be triaged enhancement feature: occ Items related to the OCC CLI interface

Comments

@flowzen1337
Copy link

Hi,

currently i use
#occ groupfolders:scan <folder_id> → trigger a filescan for a group folder
occ groupfolders:scan 104

for scanning a groupfolder, but what i want is to scan only a exact given path:

#occ groupfolders:scanpath <path> → trigger a filescan for a group folder specific path
occ groupfolders:scanpath 104/my/uploads/ → trigger a filescan for a group folder specific path

So that only the "104/my/uploads" is scanned and not the whole groupfolder with id "104" as it takes very long if there are many files/folders in it that are already known.

Is that possible somehow?

Thanks in advance! 👍

Cheers

@ZeikoFr
Copy link

ZeikoFr commented Dec 4, 2020

sudo -u www-data php occ groupfolders:scan 104/my/uploads/

Regards

@ZeikoFr
Copy link

ZeikoFr commented Dec 6, 2020

hi @flowzen1337 Does my previous command help you ?

If so be free to close the issue

@flowzen1337
Copy link
Author

hi @flowzen1337 Does my previous command help you ?

If so be free to close the issue

Will check tomorrow as i don’t have a computer around at the Moment and close it if it works, thanks in advance :-) cheers

@flowzen1337
Copy link
Author

flowzen1337 commented Dec 7, 2020

Doesnt work as expected, check my comment below :-(

@flowzen1337
Copy link
Author

flowzen1337 commented Dec 7, 2020

@ZeikoFr - Sorry, i have to reopen it, the problem is that the scan command doesnt scan the given directory only, it seems it scans the full Groupfolder:

For example:

  • [ Working fast - with some folders and just one file ]

  • GroupfolderID: 102

  • Path: /foobar/one/to/three/

  • Containing File: test.csv

  • Note: Containing only one path with only one file - scanning is fast:
    root@server:/var/www/html/nextcloud/data/__groupfolders/102# find .
    .
    ./foobar
    ./foobar/one
    ./foobar/one/two
    ./foobar/one/two/three
    ./foobar/one/two/three/test.csv

  • CMD: sudo -u www-data php /var/www/html/nextcloud/occ groupfolders:scan "102/foobar/one/two/three"
    +---------+-------+--------------+
    | Folders | Files | Elapsed time |
    +---------+-------+--------------+
    | 5 | 1 | 00:00:00 |
    +---------+-------+--------------+

But when there are already many files and paths in the folder the scanning seems to scan all files inside the groupfolders instead of just the given path:

  • [ Working Slow - many folders and many files ]
  • GroupfolderID: 104
  • Path: /Unsorted/Files/Peter/2020-2021/2020-12-09/Test_B_Subdir/"
  • Containing File: test_b.csv
  • listing: ls -l 104/Unsorted/Files/Peter/2020-2021/2020-12-09/Test_B_Subdir/
    insgesamt 0
    -rw-r--r-- 1 root root 0 Dez 7 14:01 test_b.csv
  • Note: Containing many paths and files but only the direct path to a subdir with one file is given to occ command - scanning is slow and output shows it scans much more files and directorys:
    root@server:/var/www/html/nextcloud/data/__groupfolders/104# find . | wc -l
    565
  • CMD: sudo -u www-data php /var/www/html/nextcloud/occ groupfolders:scan "104/Unsorted/Files/Peter/2020-2021/2020-12-09/Test_B_Subdir/"
    +---------+-------+--------------+
    | Folders | Files | Elapsed time |
    +---------+-------+--------------+
    | 416 | 122 | 00:01:13 |
    +---------+-------+--------------+

As you can see in the output it scanned 416 folders with 122 files and took over a minute instead of just scanning the given directory and the files included :-(

@pierreozoux pierreozoux added 0. Needs triage Issues that need to be triaged enhancement labels Mar 13, 2021
@pierreozoux pierreozoux added the feature: occ Items related to the OCC CLI interface label Apr 2, 2021
@Zegorax

This comment has been minimized.

@solracsf solracsf changed the title occ groupfolders:scan -> scan only a specific folder -> occ groupfolders:scanpath ? occ groupfolders:scan : scan only a specific folder like occ files:scan --path Sep 8, 2021
@steffenclemens
Copy link
Contributor

Hi @flowzen1337 @Zegorax, I needed the same feature so I created a pull request. You can specify the path with -p and add --shallow if you don't want to scan recursively, like you can do with files:scan. You still need to specify the folder id. Check it out, if you like: #2232

@solracsf
Copy link
Member

Hi @flowzen1337 ✋ maybe you can test #2232 and provide feedback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Issues that need to be triaged enhancement feature: occ Items related to the OCC CLI interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants