From d4d05b76d38f94e92517627cf2df94266a28bfb0 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 10 Jun 2022 03:00:13 +0200 Subject: [PATCH] update_nextcloud.sh: add '--max_allowed_packet=128M' to mysqldump command. --- update_nextcloud.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/update_nextcloud.sh b/update_nextcloud.sh index d865ba9..a8c6d70 100755 --- a/update_nextcloud.sh +++ b/update_nextcloud.sh @@ -22,6 +22,7 @@ clean_up() { if [[ -f "$_backup_crontab_file" ]]; then + blank_line echononl "(Re)Install previously saved crontab from '$_backup_crontab_file'.." crontab $_backup_crontab_file >> $log_file 2>&1 @@ -840,14 +841,30 @@ echo "" # - echononl " Backup MySQL database '$DATABASE_NAME'.." if [[ "$DATABASE_TYPE" = 'mysql' ]]; then - #mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \ - mysqldump $MYSQL_CREDENTIALS --single-transaction $DATABASE_NAME > \ + mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \ ${WEB_BASE_DIR}/${DATABASE_NAME}-v${PRIOR_VERSION}.${backup_date}.sql 2> $log_file if [[ $? -eq 0 ]]; then echo_ok else echo_failed - fatal "$(cat $log_file)" + + blank_line + echo -e "\t[ \033[33m\033[1mCommand\033[m ]: \033[37m\033[1mmysqldump $MYSQL_CREDENTIALS \\ +\t --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \\ +\t ${WEB_BASE_DIR}/${DATABASE_NAME}-v${PRIOR_VERSION}.${backup_date}.sql\033[m" + + 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 "Abbruch durch User" + blank_line + fi elif [[ "$DATABASE_TYPE" = 'postgres' ]]; then PGPASSWORD=$PSQL_PASS \