Allow backups from root
This commit is contained in:
parent
9a58486d11
commit
49c3a69282
1 changed files with 6 additions and 4 deletions
|
@ -8,10 +8,12 @@ mkdir -p "${backup_dir}"
|
||||||
if [[ -z ${customer} ]]; then
|
if [[ -z ${customer} ]]; then
|
||||||
buopts="--slave-info --safe-slave-backup"
|
buopts="--slave-info --safe-slave-backup"
|
||||||
dumpopts="--dump-slave"
|
dumpopts="--dump-slave"
|
||||||
mysql -p${MYSQL_ROOT_PASSWORD} -e "stop slave"
|
mysql -p"${MYSQL_ROOT_PASSWORD}" -u root -e "stop slave"
|
||||||
fi
|
fi
|
||||||
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}"
|
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
|
if [[ -z ${customer} ]]; then
|
||||||
mysql -p${MYSQL_ROOT_PASSWORD} -e "start slave"
|
mysql -p"${MYSQL_ROOT_PASSWORD}" -u root -e "start slave"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue