From 24f485d38bf37c72faff485f376fb987a57778d1 Mon Sep 17 00:00:00 2001 From: Josh Richards Date: Tue, 18 Apr 2023 10:39:54 -0400 Subject: [PATCH] (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 --- docker-cron.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-cron.sh b/docker-cron.sh index 4dfa4118..1115bfde 100755 --- a/docker-cron.sh +++ b/docker-cron.sh @@ -1,4 +1,11 @@ #!/bin/sh 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