Closed cesarjhony closed 1 year ago
Hello,
Can Anybody comment the preview:pre-generate normal behavior, some docker experience with Linux or windows using external storage?
I run nextcloud on my NAS.
From what I understand the Docker Container simply does not include a CRON service.
What I do is run cron on the NAS itself and execute
*/10 * * * * docker exec -itu www-data nextcloud ./occ preview:pre-generate >>/tmp/pregenerate.out 2>&1
and that works like a charm.
@Thomas-Ganter, has your NC a external storage? The great problem for me it is detect new photos on external storage.
Aaah — now I see. Sorry, i was not careful enough understanding your problem.
I fear your scenario will not work.
I read your description of external sync folder as folder that stuff gets put in from outside nextcloud not by means of API or GUI.
If my reading is correct then you are out of luck.
The pregeneration utilizes file modifications inside the nextcloud database to figure out what is new, not a filesystem scan.
Thank you Thomas.
@cesarjhony — have you tried issuing a ./occ scan:files
command first?
Like described in the Documentation?
The Preview Generator adds a listener that acts upon file write events in nextcloud. I am not too savvy when exactly these events are fired, but it might be worth a shot.
What should work in any case is to not copy the files into your directory directly but rather upload them through the interface. Here is a link to a blog post how to do this. You could then even automate this by using a staging directory:
cd your_staging_directory
find . \
-newer .lastscan \
! -name .lastscan \
-exec curl_into_your_nextcloud {} \; \
-exec here_you_could_run_a_diff_between_staging_and_final_directory {} \; \
-rm
touch .lastscan
There are certainly edge cases but this should work and might be your best shot.
Hello everyone,
I'm new in nextcloud's world, I have been testing the nextcloud as a online gallery where I have a external sync folder collecting photos in a folder and nextcloud should show them as gallery (external storage).
At every new file I make a command:
./occ preview:generate-all --path=/username/files/SyncFolder
All work as expected, but it is very slow.In the previewgenerator docs says "Add a (system) cron job for
./occ preview:pre-generate
", but when it is executed it don't return any error, any response, and quick finish. I tried theses variations logged as www-data:*/5 * * * * php -f /var/www/html/occ preview:pre-generate
./occ preview:pre-generate
php -f /var/www/html/occ preview:pre-generate
/usr/local/bin/php -f /var/www/html/occ preview:pre-generate
./occ files:scan --all
(I tried with and without this scan)My procedure is this:
docker compose up
docker exec -u www-data -it app sh
./occ preview:generate-all --path=/username/files/SyncFolder
docker exec -u www-data -it app sh
./occ files:scan --all
(new files are discovered)./occ preview:pre-generate
(nothing happen)My system is:
/var/syncfolder
docker volume/syncfolder
docker volumeThe docker-compose.yml is: