Skip to content

Allow configuring the cron.php schedule - #2598

Open
sebastiangaiser wants to merge 1 commit into
nextcloud:masterfrom
sebastiangaiser:feat/cronjob-schedule
Open

Allow configuring the cron.php schedule#2598
sebastiangaiser wants to merge 1 commit into
nextcloud:masterfrom
sebastiangaiser:feat/cronjob-schedule

Conversation

@sebastiangaiser

Copy link
Copy Markdown

The interval for cron.php is baked into the image at build time as */5 * * * * in /var/spool/cron/crontabs/www-data, and cron.sh offers no configuration at all. Changing it currently requires replacing the entrypoint and reimplementing the crond invocation downstream.

Add NEXTCLOUD_CRON_SCHEDULE, honoured by /cron.sh. When set, the crontab is written to a writable directory and crond is pointed at it with -c, so the baked crontab stays in place and an image update cannot silently restore the old interval. When unset, -c receives busybox crond's own default directory, so the behaviour is unchanged. Rewriting the baked crontab in place is not an option because it is owned by root with mode 644 and therefore not writable when the container runs as an arbitrary user.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The interval for cron.php is baked into the image at build time as */5 * * * * in /var/spool/cron/crontabs/www-data, and cron.sh offers no configuration at all. Changing it currently requires replacing the entrypoint and reimplementing the crond invocation downstream.

Add NEXTCLOUD_CRON_SCHEDULE, honoured by /cron.sh. When set, the crontab is written to a writable directory and crond is pointed at it with -c, so the baked crontab stays in place and an image update cannot silently restore the old interval. When unset, -c receives busybox crond's own default directory, so the behaviour is unchanged. Rewriting the baked crontab in place is not an option because it is owned by root with mode 644 and therefore not writable when the container runs as an arbitrary user.

Signed-off-by: Sebastian Gaiser <sebastiangaiser@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant