Skip to content

Commit

Permalink
differentiate between long and quick cron scripts in nextcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Oct 7, 2024
1 parent bbd303e commit 107fc51
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 1 addition & 3 deletions nextcloud/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +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
ADD background-worker.sh /usr/local/bin/background-worker.sh
ADD start.sh longcron.sh quickcron.sh background-worker.sh /usr/local/bin/run/
VOLUME /opt/storage /opt/config /opt/log /opt/static
EXPOSE 9787/tcp
ENTRYPOINT /usr/local/bin/run
3 changes: 0 additions & 3 deletions nextcloud/cron.sh → nextcloud/longcron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export USER=www-data HOME=/home/www-data
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

echo "Add missing db indices"
su -s /var/www/nextcloud/occ www-data -- db:add-missing-indices

Expand Down
13 changes: 13 additions & 0 deletions nextcloud/quickcron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -e

echo "Preparing environment"
cp /opt/config/config.php /var/www/nextcloud/config/config.php
chown -R www-data /var/www/nextcloud/config /var/www/nextcloud/apps /opt/log
chmod +x /var/www/nextcloud/occ
mkdir -p /run/php
export USER=www-data HOME=/home/www-data

echo "Running cron.php"
su -s /usr/bin/php www-data /var/www/nextcloud/cron.php

0 comments on commit 107fc51

Please sign in to comment.