different scripts: add '--max_allowed_packet=128M' to mysqldump command.

This commit is contained in:
Christoph 2022-06-10 03:13:06 +02:00
parent d4d05b76d3
commit d7018d7aec
6 changed files with 113 additions and 12 deletions

View File

@ -628,13 +628,30 @@ echo ""
# -
echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
mysqldump $MYSQL_CREDENTIALS --single-transaction $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${CURRENT_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 \

View File

@ -628,13 +628,30 @@ echo ""
# -
echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${CURRENT_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 \

View File

@ -628,13 +628,30 @@ echo ""
# -
echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${CURRENT_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 \

View File

@ -653,13 +653,30 @@ echo ""
# -
echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${CURRENT_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 \

View File

@ -653,13 +653,30 @@ echo ""
# -
echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${CURRENT_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 \

View File

@ -683,13 +683,29 @@ echo ""
# -
echononl " Backup MySQL database '$DATABASE_NAME'.."
if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
mysqldump $MYSQL_CREDENTIALS --opt $DATABASE_NAME > \
mysqldump $MYSQL_CREDENTIALS --max_allowed_packet=128M --single-transaction $DATABASE_NAME > \
${WEB_BASE_DIR}/${DATABASE_NAME}-v${CURRENT_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 \