From f7e0a3e091465db967374134257d62ebfa640e8a Mon Sep 17 00:00:00 2001 From: ftsell Date: Fri, 4 Oct 2024 22:03:51 +0200 Subject: [PATCH] add custom cron file to nextcloud image --- nextcloud/Dockerfile | 1 + nextcloud/cron.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 nextcloud/cron.sh diff --git a/nextcloud/Dockerfile b/nextcloud/Dockerfile index 635b9ce..a850ddb 100644 --- a/nextcloud/Dockerfile +++ b/nextcloud/Dockerfile @@ -75,6 +75,7 @@ RUN ln -sf /opt/config/nginx.conf /etc/nginx/sites-enabled/default; \ RUN chown www-data /opt/config ADD start.sh /usr/local/bin/run +ADD cron.sh /usr/local/bin/cron.sh VOLUME /opt/storage /opt/config /opt/log /opt/static EXPOSE 9787/tcp ENTRYPOINT /usr/local/bin/run diff --git a/nextcloud/cron.sh b/nextcloud/cron.sh new file mode 100755 index 0000000..7fa6e49 --- /dev/null +++ b/nextcloud/cron.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env sh +set -e + +echo "Preparing environment" +cd /var/www/nextcloud +chmod +x ./occ + +echo "Syncing system address books with dav" +su -s /var/www/nextcloud/occ www-data dav:sync-system-addressbook + +echo "Running cron.php" +su -s /usr/bin/php www-data /var/www/nextcloud/cron.php +