update_nextcloud.sh: add '--max_allowed_packet=128M' to mysqldump command.

This commit is contained in:
Christoph 2022-06-10 03:00:13 +02:00
parent be414fbc61
commit d4d05b76d3

View File

@ -22,6 +22,7 @@ clean_up() {
if [[ -f "$_backup_crontab_file" ]]; then if [[ -f "$_backup_crontab_file" ]]; then
blank_line
echononl "(Re)Install previously saved crontab from '$_backup_crontab_file'.." echononl "(Re)Install previously saved crontab from '$_backup_crontab_file'.."
crontab $_backup_crontab_file >> $log_file 2>&1 crontab $_backup_crontab_file >> $log_file 2>&1
@ -840,14 +841,30 @@ echo ""
# - # -
echononl " Backup MySQL database '$DATABASE_NAME'.." echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
#mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \ mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${PRIOR_VERSION}.${backup_date}.sql 2> $log_file ${WEB_BASE_DIR}/${DATABASE_NAME}-v${PRIOR_VERSION}.${backup_date}.sql 2> $log_file
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
echo_ok echo_ok
else else
echo_failed 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 fi
elif [[ "$DATABASE_TYPE" = 'postgres' ]]; then elif [[ "$DATABASE_TYPE" = 'postgres' ]]; then
PGPASSWORD=$PSQL_PASS \ PGPASSWORD=$PSQL_PASS \