2018-12-02 02:08:31 +01:00
|
|
|
#!/usr/bin/env bash
|
2018-12-07 00:30:27 +01:00
|
|
|
set -e
|
2020-08-28 21:45:17 +02:00
|
|
|
[[ ! -z "$DEBUG" ]] && set -x
|
2018-12-02 02:08:31 +01:00
|
|
|
|
|
|
|
if [[ -z "$NEXTCLOUD_CONTAINER_NAME" ]]; then
|
|
|
|
echo "NEXTCLOUD_CONTAINER_NAME is a required variable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-08-28 21:45:17 +02:00
|
|
|
# Print info about how we will look for Nextcloud
|
|
|
|
if [[ -n "$NEXTCLOUD_PROJECT_NAME" ]]; then
|
|
|
|
echo "Will search for Nexcloud container as a Docker Compose service"
|
|
|
|
echo "Project: $NEXTCLOUD_PROJECT_NAME, Service: $NEXTCLOUD_CONTAINER_NAME"
|
|
|
|
else
|
|
|
|
echo "Container Name: $NEXTCLOUD_CONTAINER_NAME"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Do an initial search for the container to rule out any configuration problems
|
|
|
|
containerId="$(/find-container.sh)"
|
|
|
|
if [[ -z "$containerId" ]]; then
|
|
|
|
echo "ERROR: Unable to find the Nextcloud container"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Found Nextcloud container with ID $containerId"
|
|
|
|
fi
|
|
|
|
|
2019-06-21 02:15:55 +02:00
|
|
|
echo "*/$NEXTCLOUD_CRON_MINUTE_INTERVAL * * * * /cron-tasks.sh" \
|
2018-12-02 02:08:31 +01:00
|
|
|
> /var/spool/cron/crontabs/root
|
|
|
|
|
2019-02-03 19:46:12 +01:00
|
|
|
echo "Starting crond"
|
|
|
|
exec crond -f -l 0
|