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 \