6416dd8731
If the Nextcloud container is recreated while the cronjob container is still running, the ID of the container is obtained each time the cron tasks are executed. Previously it was cached on entrypoint, so if the ID changed this container would fail.
13 lines
292 B
Bash
Executable file
13 lines
292 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
if [[ -z "$NEXTCLOUD_CONTAINER_NAME" ]]; then
|
|
echo "NEXTCLOUD_CONTAINER_NAME is a required variable"
|
|
exit 1
|
|
fi
|
|
|
|
echo "*/$NEXTCLOUD_CRON_MINUTE_INTERVAL * * * * /cron-tasks.sh" \
|
|
> /var/spool/cron/crontabs/root
|
|
|
|
echo "Starting crond"
|
|
exec crond -f -l 0
|