how to run cron job on nextcloud plugin (preview-generator app)

robot381

Cadet
Joined
Mar 5, 2021
Messages
4
Hi,

I noticed my nextcloud plugin is performing very poorly on my mobile, not really functioning as a google photos replacement.

Upon searching on google, it seems to be due to the fact that nextcloud doesn't generate the previews proactively, and that i need to run a separate application within nextcloud system.

It is recommending me to do :

The app does not replace on demand preview generation so if a preview is requested before it is pre-generated it will still be shown. The first time you install this app, before using a cron job, you properly want to generate all previews via: ./occ preview:generate-all -vvv
Important
: To enable pre-generation of previews you must add php /var/www/nextcloud/occ preview:pre-generate to a system cron job that runs at times of your choosing.

How would i go about doing this?

Thank you for the help!!
 

taaangy234

Dabbler
Joined
Dec 7, 2016
Messages
18
I'm with you, can someone explain this better running on TrueNAS/iocage jail?
I'm sure I ran into this issue on FreeNAS before, end up spin NC on an Ubuntu VM, the instruction seems to apply to Ubuntu node base on my note in 2019, how I got it working.

I tried run from TrueNAS Shell.
iocage list
jexec (# of my jail) tcsh
./occ preview:generate-all -vvv
./occ: command not found.
when I navigate through my \\TrueNAS\iocage\jails\nextcloud\root\var www folder doesn't exist.

I'm stuck!!! image/video thumbnail should of been baked into NC, speeding hours trying to figure this out.
Please help!!!
 

Solid.Snake

Cadet
Joined
Jun 18, 2022
Messages
2
I'm with you, can someone explain this better running on TrueNAS/iocage jail?
I'm sure I ran into this issue on FreeNAS before, end up spin NC on an Ubuntu VM, the instruction seems to apply to Ubuntu node base on my note in 2019, how I got it working.

I tried run from TrueNAS Shell.
iocage list
jexec (# of my jail) tcsh
./occ preview:generate-all -vvv
./occ: command not found.
when I navigate through my \\TrueNAS\iocage\jails\nextcloud\root\var www folder doesn't exist.

I'm stuck!!! image/video thumbnail should of been baked into NC, speeding hours trying to figure this out.
Please help!!!
hello Tanguy,

"when I navigate through my \\TrueNAS\iocage\jails\nextcloud\root\var www folder doesn't exist."
>> You should not navigate here


I'm also lost regarding the poor explanation, but you did start well, here some additional actions :

#iocage list
#jexec (# of my jail) tcsh
#/usr/libexec/locate.updatedb >>In order to refresh the locate (search engine) database
#locate occ >>Where is located the occ binary file (supposed to be located here : /usr/local/bin/occ)
#/usr/local/bin/occ preview:generate-all -vvv
 

Solid.Snake

Cadet
Joined
Jun 18, 2022
Messages
2
Hi,

I can't edit my previous message, so here is the following post :


#/usr/local/bin/occ preview:generate-all -vvv >>suppose to manually trigger a preview generation.

Now, it it time to let this process run periodically and automatically by:

#which php >>show the path of the actual php binary (copy it > /usr/local/bin/php)
#crontab -e -u root >> (-e for visual editor, -u to specify the user)

Now past this under the first existing line (hit i for inserting text, tricky, but I had to do it for every step while pasting this line) :
0 7 * * * /usr/local/bin/php -f /usr/local/bin/occ preview:generate-all -vvv >> supposed to be trigger everyday @ 7AM

To save the crontab job, hit : ESC, wq! (ESC = escape the edition mode, w=write, q=quit, !=force quit)


Here, I didn't try it yet, but it should normaly work.

PS : do not hesitate to quote/correct me if needed.
Did help ? please subscribe and leave a thanks msg

Yours

TAG : nextcloud preview generator image picture truenas cron automatically
 
Top