How to simulate the command “sudo -u www-data php occ -v files:scan %userid% --path="/%userid%/files/Folder/” from inside a custom Nextcloud app. Is that possible?
I’ve made an app for Nextcloud that runs an external process (binary) which in turn generates some files in a user folder.
The problem is that Nextcloud is unable to list those files until I run the “files:scan” command from the “occ” manually.
But in order to run “occ” I need access to the server terminal or run the command in a cron, which is not the most efficient way to do this.
I was wondering if Nextcloud has some Class or API that I can run to rescan a folder from within my Nextcloud app for the current user.
Any help is highly appreciated.
Greetings and thanks.