0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-21 03:06:08 +02:00

(Cron) Preview Generator support

Allow the user to enable and configure a cron entry for the NC Preview Generator.

To do so, add CRON_PREVIEW={hour} (allowed values for hour are 0-23 since cron uses 24H system) in the startup environment parameters for the cron service container.

User must install the Preview Generator app ahead of time from the app store.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
This commit is contained in:
Josh Richards 2023-04-18 10:39:54 -04:00 committed by GitHub
parent 8df9b2617e
commit 24f485d38b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,11 @@
#!/bin/sh #!/bin/sh
set -eu set -eu
# Set-up cron entry for previewgenerator (https://apps.nextcloud.com/apps/previewgenerator)
# Note: the user should make sure they install the app first and we could check here but it's non-fatal...
if [ -n "${CRON_PREVIEW+x}" ]; then
echo "Configuring Preview Generator to run at ${CRON_PREVIEW}:00 (24H system time) if /cron.sh is activated"
echo "* ${CRON_PREVIEW} * * * /var/www/html/occ preview:pre-generate" >> /var/spool/cron/crontabs/www-data
fi
exec busybox crond -f -l 0 -L /dev/stdout exec busybox crond -f -l 0 -L /dev/stdout