mirror of
https://github.com/luzifer-docker/mariadb-backup.git
synced 2024-11-09 23:30:02 +00:00
Several fixes
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
f909a3bab5
commit
17ca0b9294
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
function step() {
|
function step() {
|
||||||
echo "[$(date +%Y-%m-%d %H:%M:%S)] $@"
|
echo "[$(date +"%Y-%m-%d %H:%M:%S")] $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -z "${MYSQL_PASSWORD:-}" ] && {
|
[ -z "${MYSQL_PASSWORD:-}" ] && {
|
||||||
|
@ -16,7 +16,7 @@ while [ 1 ]; do
|
||||||
DELETE_OLDER_THAN=${DELETE_OLDER_THAN:-2}
|
DELETE_OLDER_THAN=${DELETE_OLDER_THAN:-2}
|
||||||
|
|
||||||
# This directory is exposed by the postgres image
|
# This directory is exposed by the postgres image
|
||||||
TARGET_DIR=/var/lib/postgresql/data
|
TARGET_DIR=/data
|
||||||
|
|
||||||
BACKUP_DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
BACKUP_DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ while [ 1 ]; do
|
||||||
step "Creating backup of ${db_name} in ${TARGET_FILE}..."
|
step "Creating backup of ${db_name} in ${TARGET_FILE}..."
|
||||||
mysqldump \
|
mysqldump \
|
||||||
-h "${MYSQL_HOST:-mariadb}" -u "${MYSQL_USER:-root}" -p${MYSQL_PASSWORD} \
|
-h "${MYSQL_HOST:-mariadb}" -u "${MYSQL_USER:-root}" -p${MYSQL_PASSWORD} \
|
||||||
-a --database "${db_name}" | gzip >"${TARGET_FILE}"
|
-a --databases "${db_name}" | gzip >"${TARGET_FILE}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Dump grants
|
# Dump grants
|
||||||
|
|
Loading…
Reference in a new issue