Update 'backup_mysql.sh'

This commit is contained in:
Yavuz Aydın 2021-11-16 11:15:38 +01:00
parent cc9ee4d579
commit a8fb14438e
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ else
[ ! -d ${DB_BKP_FLDR} ] && mkdir -p ${DB_BKP_FLDR} && chmod 700 ${DB_BKP_FLDR}
# Get the schema of database with the stored procedures.
# This will be the first file in the database backup folder
${MYSQLDUMP_BIN} ${MYSQL_OPTS} -R -d --add-drop-trigger --single-transaction ${DB} | gzip -c > ${DB_BKP_FLDR}/000-DB_SCHEMA.sql.gz
${MYSQLDUMP_BIN} ${MYSQL_OPTS} -R -d --add-drop-trigger --single-transaction ${DB} | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | gzip -c > ${DB_BKP_FLDR}/000-DB_SCHEMA.sql.gz
index=0
#Get the tables and its type. Store it in an array.
table_types=($(${MYSQL_BIN} ${MYSQL_OPTS} -e "show table status from \`${DB}\`" | awk '{ if ($2 == "MyISAM" || $2 == "InnoDB") print $1,$2}'))