From 4abff5e4fad680a223068baaef152e2e8e3d80e8 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 19 Oct 2024 01:43:03 +0200 Subject: [PATCH] update_nextcloud.sh: run 'Migrating the mimetypes' job after update. --- update_nextcloud.sh | 77 ++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/update_nextcloud.sh b/update_nextcloud.sh index a5f47fb..0ba02dd 100755 --- a/update_nextcloud.sh +++ b/update_nextcloud.sh @@ -1436,41 +1436,60 @@ else [[ $OK = "yes" ]] || fatal "Interrupted by user." fi +echononl " Migrating the mimetypes .." +su -c "${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ maintenance:repair --include-expensive" -s /bin/bash $HTTP_USER > $log_file 2>&1 +if [[ $? -eq 0 ]]; then + echo_ok +else + echo_failed + error "$(cat $log_file)" -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]: " + echononl "continue anyway [yes/no]: " read OK OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" -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]: " + 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." - - fi + done + [[ $OK = "yes" ]] || fatal "Interrupted by user." fi + + +#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:]')" +#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