From a9fb3067dff774911ef1eac149ac6e0c171669f7 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 23 Dec 2023 02:28:46 +0100 Subject: [PATCH] update_nextcloud.sh: start the cronjon manually only on demand. --- update_nextcloud.sh | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/update_nextcloud.sh b/update_nextcloud.sh index ae98110..d5f5c5a 100755 --- a/update_nextcloud.sh +++ b/update_nextcloud.sh @@ -1422,24 +1422,39 @@ else [[ $OK = "yes" ]] || fatal "Interrupted by user." fi -echononl " Run cronjob manually.. (can take a very long time)" -echo_wait -su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/cron.php" -s /bin/bash $HTTP_USER > $log_file 2>&1 -if [[ $? -eq 0 ]]; then - echo_ok -else - echo_failed - error "$(cat $log_file)" - echononl "continue anyway [yes/no]: " +echo "" +echo " Would you like to run the cronjob manually - it may take a realy long time! " +echo "" +echononl " Run cronjob manually [yes/no]: " +read OK +OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" +while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " read OK OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" - while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do - echononl "Wrong entry! - repeat [yes/no]: " - read OK - done - [[ $OK = "yes" ]] || fatal "Interrupted by user." +done +if [[ $OK = "yes" ]] ; then + echononl " Run cronjob manually.. (can take a very long time)" + echo_wait + su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/cron.php" -s /bin/bash $HTTP_USER > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $log_file)" + + echononl "continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Interrupted by user." + + fi fi blank_line