From d8b9e7726b9c9d18306559cc0b7d3551e057856b Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 4 May 2019 19:58:46 +0200 Subject: [PATCH] update_nextcloud.sh: Fix error eupdateing postgres database. --- update_nextcloud.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/update_nextcloud.sh b/update_nextcloud.sh index f0f45fd..4f9d40e 100755 --- a/update_nextcloud.sh +++ b/update_nextcloud.sh @@ -550,7 +550,9 @@ if [[ "$DATABASE_TYPE" = 'mysql' ]]; then fatal "$(cat $log_file)" fi elif [[ "$DATABASE_TYPE" = 'postgres' ]]; then - PGPASSWORD=$PSQL_PASS pg_dump $DATABASE_NAME -h $PSQL_SERVER -U $PSQL_USER -f postfix-${backup_date}.sql + PGPASSWORD=$PSQL_PASS \ + pg_dump $DATABASE_NAME -h $PSQL_SERVER -U $PSQL_USER \ + -f ${WEB_BASE_DIR}/${DATABASE_NAME}-v${PRIOR_VERSION}.${backup_date}.sql 2> $log_file if [[ $? -eq 0 ]]; then echo_ok else @@ -567,7 +569,16 @@ if [[ $? -eq 0 ]]; then echo_ok else echo_failed - fatal "$(cat $log_file)" + 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 ny user." fi mkdir ${WEB_BASE_DIR}/nextcloud-${VERSION} > $log_file 2>&1