hi i am using nc latest and uploaded some files via sftp.
how can i setup a cronjob that rescans the files of this folder:
/data/telemarker/files/bilder
probably i need to setup a php file and use the cronjob to activate that.
but im a newbie and have no glue at - any help is highly appreaciated.
thanks
telemarker
My opinion on that is to not regularly run files:scan but instead use the external storage app for any folder that shall regularly get accessed/changed externally since it has some very practical features for this and is meant for this usecase.
actually i just need to run the scan every now and then when i upload large files (since this is not supported by the nc client). but my ssh is not working, so i need to make nc rescan somehow from the server. maybe i could run a .php or .sh file via url?
ok, i set up the external drive - but it runs pretty slow - maybe its scanning right now. but i can see just the folders and files - no thumbnails of images at all.
also i got some errors popping up.
to me this makes not much sense - why should i setup a subfolder from /data as an external drive, if its allready at the same server. looks like this slows down performance of the whole system.
so if you can provide me with the solution to rescan folders via cronjob it would be highly appreciated.
basically a cronjob would look like this:
edit crontab of the werbserver user: sudo crontab -u www-data
add a line e.g. like this: 0 */1 * * * php -f /path/to/nextcloud/occ files:scan --all
which would run the scan every hour. Afterwards save the file.
thanks, i looked in the cron manager from my hosting and i can only run an url in a certain time interval (e.g. daily from 6-12 a.m.)
this means i could setup a cron that runs a subdomain.
how can i put your files:scan --all command onto the server so it gets activated everytime i open this url cron.mydomain.com?
sorry my server seems to be a bit limited.
Sry, I cannot help with that. It also looks like a security issue to me if you just open an url which runs any code on your server but I could be wrong.
hello szaimen,
i make a workaround and can now use ssh from my android device.
i easily could connect to the server, walk to the nextcloud directory and tried $ php -f /cloud/occ files:scan --all
but then i got: no input file specified.
i also tried: $ sudo -u www-data php /cloud/occ files:scan --all
but then it says: command not found.
what i am doing wrong here? (nextcloud is installed in /cloud)
thanks
telemarker