Allow backups from root
This commit is contained in:
parent
2c61a00ebd
commit
62d172b2f5
1 changed files with 6 additions and 4 deletions
|
@ -8,10 +8,12 @@ mkdir -p "${backup_dir}"
|
|||
if [[ -z ${customer} ]]; then
|
||||
buopts="--slave-info --safe-slave-backup"
|
||||
dumpopts="--dump-slave"
|
||||
mysql -p${MYSQL_ROOT_PASSWORD} -e "stop slave"
|
||||
mysql -p"${MYSQL_ROOT_PASSWORD}" -u root -e "stop slave"
|
||||
fi
|
||||
mariadb-backup --backup ${buopts} -u root -p${MYSQL_ROOT_PASSWORD} --stream=xbstream | gzip >"${backup_dir}/${stream_name}"
|
||||
mysqldump --all-databases --single-transaction ${dumpopts} -u root -p${MYSQL_ROOT_PASSWORD} | gzip >"${backup_dir}/${dump_name}"
|
||||
# shellcheck disable=SC2086
|
||||
mariadb-backup --backup ${buopts} -u root -p"${MYSQL_ROOT_PASSWORD}" --stream=xbstream | gzip >"${backup_dir}/${stream_name}"
|
||||
# shellcheck disable=SC2086
|
||||
mysqldump --all-databases --single-transaction ${dumpopts} -u root -p"${MYSQL_ROOT_PASSWORD}" | gzip >"${backup_dir}/${dump_name}"
|
||||
if [[ -z ${customer} ]]; then
|
||||
mysql -p${MYSQL_ROOT_PASSWORD} -e "start slave"
|
||||
mysql -p"${MYSQL_ROOT_PASSWORD}" -u root -e "start slave"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue