Clarity on the crontab settings for the preview generator app


#42

I can confirm this problem with the occ preview:pre-generate command with an MP3 file w/o cover. In my case it is one file of a series of single channel frequency tone files from FreeMosquitoRingtones.org.


#43

Not the only one!


In the worst case your box is getting frozen.

I would suggest to downgrade it to beta state until the bugs are not fixed.


#44

Yeah I know the app is not perfect. At the moment I simply don’t have the time/priority to work on this in my free time.

But pull requests are welcome


#45

Hi,

I’m getting following error on nextcloud box after preview:generate-all and preview: pre-generate

ERROR: ld.so: object ‘/usr/lib/arm-linux-gnueabihf/libarmme
.so’ from /etc/ld.so.preload cannot be preloaded (cannot op
n shared object file): ignored.
The process control (PCNTL) extensions are required in case
you want to interrupt long running commands - see http://ph
.net/manual/en/book.pcntl.php
[Symfony\Component\Console\Exception\CommandNotFoundExcep
ion]
There are no commands defined in the “preview” namespace.

I appreciate if someone could help…


#46

Hmm, app is definitely enabled successfully? Did you try to remove it and redownload/enable?


#47

I reenabled the app and rebooted the server. Still the same error… Someone else opened an issue with the same error on different commands on nextcloud-snap github…


#48

Yes that’s true, I also did see PCNTL errors on two other topics in combination with nc box/snap.


#49

What in case we copy files into a nextcloud user’s folder directly on the file system - is it succicient to run files:scan to get them added to the mentioned list?


#50

What happens if files are deleted directly from the system? Will the preview-files still be stored on the disk?


#51

in my config.php:
‘preview_max_x’ => 256,
‘preview_max_y’ => 256,
‘preview_max_scale_factor’ => 1,

in Generate.php and PreGenerate.php:

$maxW = (int)$this->config->getSystemValue(‘preview_max_x’, 2048);
$maxH = (int)$this->config->getSystemValue(‘preview_max_y’, 2048);

$s = 256;
while ($s <= $maxW || $s <= $maxH) {
$this->sizes[‘square’][] = $s;
$s *= 2;
}

$w = 256;
while ($w <= $maxW) {
$this->sizes[‘width’][] = $w;
$w *= 2;
}

$h = 256;
while ($h <= $maxH) {
$this->sizes[‘height’][] = $h;
$h *= 2;
}

As a result, in my /preview catalog only 2 files (for each *.jpg) are generated instead of ten or more files (170-170crop.png and 256-170max.png). This greatly accelerated my server based on Pi.
But if I manualy delete files from Linus file system, NC don’t understand this. What method may be used for cleaning database records?


#52

Since the generation of images takes time on a slower board like a RP3 and the preview command is in a cron job, what happens if I set the cron for every hour and the cron runs the job again while the previous job has not completed? Will it detect that the job is already running and exit gracefully?

Thank you


#53

@rullzer what say you?


#54

Yes.

You can start the cronjob like that to find it out:

*/20 * * * * php /var/www/nextcloud/occ preview:pre-generate >> /var/ncdata/preview.log


#55

Sorry for digging this thread up, but does anyone here have experience with hosted systems i.e. from all-inkl.de?
My nextcloud instance is running on one of their hosted packages and my suspicion ist that there is no way I can run the cronjobs needed there without terminal access?

sorry, complete noob here :frowning:


#56

Looks like you need to pay to enable it:
image


#57

You’ll need the hosting package “PrivatPlus” in order to be able to use cronjobs.
When you only have the package “Privat”, there are no cronjobs available (see here).


#58

Sorry for not clarifying it im on the PrivatPremnium package, and now i found cronjobs, but it only gives me these options:

In Github there is written:

  1. Add a (system) cron job for ./occ preview:pre-generate

Idk how to go from there.
Should I copy the ./occ preview:pre-generate in the cron.php? And if yes, where?
I tried so find some videos about it, tbh now I’m even more confused…thank you for your help guys


#59

Ok, so you can’t call ssh scripts directly. Maybe this will help.


#60

Thank you, seems like I’m not allowed to run this command on all-inkl:

Array
(
    [0] => sh: ./occ: Permission denied
)

Does anyone have a recommendation for a hoster that allows this? Nextcloud run awfully slow, I use it for my private photo database and right now, there are around 200 GB of photos in it.

UPDATE: If anyone has the same problem: all-inkl support did edit my script so that it works:

<?php exec("php70 occ preview:pre-generate 2>&1", $out, $result); echo "Returncode: " .$result ."
"; echo "Ausgabe des Scripts: " ."
"; echo "
"; print_r($out);
?>

Turns out I’m not on a server with OPchache enabled, that also contributes to the slow performance, they will move me to a server with OPcache enabled.
Thank you all for your support