Under Piwigo 13 and earlier, I had a script I could run that would go through every image in the gallery, "touching" it and triggering thumbnails. The script was found online (I'd need to dig up the URL), there is a TXT version of it at:
https://www.aiskon.net/public/piwigo-thumb-generate.txt
Under the 14.0b3 and rc1, it fails with the following error:
root@piwigo:/ # /usr/local/www/html/piwigo/local/config/piwigo-thumb-generate.sh --2023-11-18 17:56:31-- https://piwigotest.aiskon.net/ws.php?format=json&method=pwg.session.login Resolving piwigotest.aiskon.net (piwigotest.aiskon.net)... 10.0.0.240, fd4b:c2c4:3b9a:49fb:2a0:98ff:fe65:1493 Connecting to piwigotest.aiskon.net (piwigotest.aiskon.net)|10.0.0.240|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 27 [text/plain] Saving to: ‘ws.php?format=json&method=pwg.session.login.tmp’ ws.php?format=json& 100%[===================>] 27 --.-KB/s in 0s 2023-11-18 17:56:31 (1.36 MB/s) - ‘ws.php?format=json&method=pwg.session.login.tmp’ saved [27/27] Removing ws.php?format=json&method=pwg.session.login.tmp. 2023-11-18 17:56:31 URL:https://piwigotest.aiskon.net/ws.php?format=json&method=pwg.getMissingDerivatives [18061] -> "missing.json" [1] while: Expression Syntax. root@piwigo:/ #
Any idea what I need to change for this to work under 14.0?
Thank you!
Offline
Found the original post, it's at:
https://freeandthings.wordpress.com/201 … in-piwigo/
Offline
Note the
while: Expression Syntax.
output line, that indicates a shell error with the script in one of the while loops. So run just the first two wget commands and inspect the missing.json file, and then what the sed command sequence produces that would be fed to the second while, whether it makes sense or not, and if a resulting line would deliver expected results with
wget -nv -O /dev/null $line
Btw, maybe $line should be quoted as "$line" to not get broken into shell patterns.
And btw, I would not run such as root.
Also, such scripts should start with
set -e
so they bail out on pipeline errors.
Offline
Thank you - made some modifications, ran it as www instead of root, and it seems to be working. I'll let it run overnight and see how it behaves.
If it works as expected, I'll post an article on my personal blog with full details, and link it here.
Offline