diff --git a/Dockerfile b/Dockerfile index ef6f363..42e0755 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,7 +75,7 @@ LABEL org.label-schema.vcs-url "https://github.com/otherguy/docker-dropbo LABEL org.label-schema.vcs-ref "${VCS_REF}" # Configurable sleep delay -ENV SLEEP_DELAY=5 +ENV POLLING_INTERVAL=5 # Install init script and dropbox command line wrapper COPY docker-entrypoint.sh / diff --git a/README.md b/README.md index 464b7ab..8278379 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ files. Defaults to `1000`. If set to `true`, skips updating the Dropbox app on container startup. _Note:_ This is not very reliable because the Dropbox daemon will still try to update itself even if this is set to `true`. -- `SLEEP_DELAY` +- `POLLING_INTERVAL` Needs to be set to a positive integer value. The Dropbox daemon is polled for its status at regular intervals, which can be configured to reduce load on the system. This is the number in seconds to wait between polling the Dropbox daemon. Defaults to `5`. diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6f1c261..35b38dd 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -31,9 +31,9 @@ if [ -z "$(grep ":${DROPBOX_GID}:" /etc/group)" ]; then groupadd -g $DROPBOX_GID dropbox fi -if [[ ! "${SLEEP_DELAY}" =~ ^[0-9]+$ ]]; then - echo "SLEEP_DELAY not set to a valid number, defaulting to 5!" - export SLEEP_DELAY=5 +if [[ ! "${POLLING_INTERVAL}" =~ ^[0-9]+$ ]]; then + echo "POLLING_INTERVAL not set to a valid number, defaulting to 5!" + export POLLING_INTERVAL=5 fi # Set dropbox account's UID/GID. @@ -106,5 +106,5 @@ sleep 5 while kill -0 ${DROPBOX_PID} 2> /dev/null; do [ -d "/proc/${DROPBOX_PID}" ] && [ -f "/opt/dropbox/.dropbox/info.json" ] && gosu dropbox dropbox status /usr/bin/find /tmp -maxdepth 1 -type d -mtime +1 -exec rm -rf {} \; - /bin/sleep ${SLEEP_DELAY} + /bin/sleep ${POLLING_INTERVAL} done