diff --git a/README.md b/README.md index d8e17b3..b0fe344 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,8 @@ above. However, it is explicitly specified for example purposes. * All cron task shell scripts run at the same interval defined by `NEXTCLOUD_CRON_MINUTE_INTERVAL`. * Modification of your own shell scripts on the host do not require that you restart/recreate the container (only when volume mappings change in the YAML file). +* If a custom script in the `/cron-scripts` directory fails, it will not impede the processing of + other scripts in the directory. ## Debugging diff --git a/scripts/cron-tasks.sh b/scripts/cron-tasks.sh index c4d9c9e..aaf188a 100755 --- a/scripts/cron-tasks.sh +++ b/scripts/cron-tasks.sh @@ -21,9 +21,10 @@ echo "> Nextcloud Container ID: ${containerId}" run_scripts_in_dir() { cd "$1" - for script in *.sh; do - echo "> Running Script: $script" - nextcloud_exec "$containerId" "$(< $script)" + find . -type f -name '*.sh' -print0 | + while IFS= read -r -d '' file; do + echo "> Running Script: $file" + nextcloud_exec "$containerId" "$(cat $file)" || continue done } diff --git a/scripts/nextcloud-exec.sh b/scripts/nextcloud-exec.sh index a6d978f..0ed574e 100644 --- a/scripts/nextcloud-exec.sh +++ b/scripts/nextcloud-exec.sh @@ -9,7 +9,7 @@ nextcloud_exec_no_shell() { exec_user="--user $NEXTCLOUD_EXEC_USER" fi - docker exec $exec_user -i "$containerId" "$@" + docker exec $exec_user "$containerId" "$@" } nextcloud_exec() {