Thank you, I have added the script you had written into userscripts, but i am seeing,
START SCANNING FOR NEXTCLOUD FILES&FOLDERS
{"reqId":"Lbtqsgo4geN8p2pVBL5m","level":3,"time":"2023-09-01T11:07:37+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/html/data/data_dir_writability_test_64f1c5f959655.tmp): Failed to open stream: Permission denied at /var/www/html/lib/private/legacy/OC_Util.php#579","userAgent":"--","version":"27.0.2.1","data":{"app":"PHP"}}
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.
Your data directory is not writable.
Permissions can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/27/go.php?to=admin-dir_permissions.
{"reqId":"Lbtqsgo4geN8p2pVBL5m","level":3,"time":"2023-09-01T11:07:37+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/html/data/nextcloud.log): Failed to open stream: Permission denied at /var/www/html/lib/private/Log/File.php#84","userAgent":"--","version":"27.0.2.1","data":{"app":"PHP"}}
I have used the file browser to change the permissions for the nextcloud appdata and nextcloud data share to read/write, but this is what im seeing. There is a .ocdata in the root of the data directory.