From 9e447a570ea37dd29a998844cbebc4080a2d527c Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Tue, 4 May 2021 17:13:05 +0200 Subject: [PATCH] sleep timer configuration --- Dockerfile | 1 + README.md | 1 + start.sh | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 12644f9..45890a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ ENV NEXTCLOUD_DOWNLIMIT= ENV NEXTCLOUD_EXCLUDEFILE= ENV NEXTCLOUD_UNSYNCFILE= ENV NEXTCLOUD_SILENT= +ENV NEXTCLOUD_SLEEP=30 COPY start.sh /start.sh diff --git a/README.md b/README.md index f90b84c..1db18de 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ docker-compose up -d | NEXTCLOUD_EXCLUDEFILE | | Path to a file, inside the container, which contains a list of excluded directories/files | | NEXTCLOUD_UNSYNCFILE | | Path to a file, inside the container, which contains a list of remote unsynced folders (selective sync) | | NEXTCLOUD_SILENT | | If set to "1", the client will run in silent mode, with a lot less log messages | +| NEXTCLOUD_SLEEP | 30 | Seconds of sleep time between every client runs | | USER_NAME | nextcloudclient | Internal username used by nextcloud client | | USER_UID | 1000 | Internal UID used by nextcloud client | | USER_GID | 1000 | Internal GID used by nextcloud client | diff --git a/start.sh b/start.sh index 041cbbf..5f6a279 100755 --- a/start.sh +++ b/start.sh @@ -9,6 +9,7 @@ NEXTCLOUD_PASSWORD=${NEXTCLOUD_PASSWORD:-password} NEXTCLOUD_URL=${NEXTCLOUD_URL:-https://nextcloud.example.com} NEXTCLOUD_DIR=${NEXTCLOUD_DIR:-/data} NEXTCLOUD_DIR_CHOWN=${NEXTCLOUD_DIR_CHOWN:-1} +NEXTCLOUD_SLEEP=${NEXTCLOUD_SLEEP:-30} # check if group already exists GRP_NAME=$(getent group ${USER_GID} ) @@ -70,5 +71,5 @@ PARAMS="${PARAMS} --non-interactive -u ${NEXTCLOUD_USERNAME} -p ${NEXTCLOUD_PASS # main loop while true; do /bin/su -s /bin/sh ${USER_NAME} -c "/usr/bin/nextcloudcmd ${PARAMS}" - sleep 10 + sleep ${NEXTCLOUD_SLEEP} done