0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-21 03:06:08 +02:00
nextcloud-docker/docker-cron.sh
Josh Richards ea6c4b3366
Support updating CRON_PREVIEW time
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
2023-04-18 12:03:43 -04:00

13 lines
709 B
Bash
Executable file

#!/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"
sed -n -e '/preview:pre-generate/!p' -e "\$a\* ${CRON_PREVIEW} \* \* \* /var/www/html/occ preview:pre-generate" \
/var/spool/cron/crontabs/www-data > /var/spool/cron/crontabs/www-data.tmp && \
mv /var/spool/cron/crontabs/www-data.tmp /var/spool/cron/crontabs/www-data
fi
exec busybox crond -f -l 0 -L /dev/stdout