From 17ca0b9294a138d6bd4ea24e8bee697e3d1cf94f Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 20 Mar 2018 12:43:39 +0100 Subject: [PATCH] Several fixes Signed-off-by: Knut Ahlers --- backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup.sh b/backup.sh index a09d2d4..c94690b 100755 --- a/backup.sh +++ b/backup.sh @@ -2,7 +2,7 @@ set -euo pipefail function step() { - echo "[$(date +%Y-%m-%d %H:%M:%S)] $@" + echo "[$(date +"%Y-%m-%d %H:%M:%S")] $@" } [ -z "${MYSQL_PASSWORD:-}" ] && { @@ -16,7 +16,7 @@ while [ 1 ]; do DELETE_OLDER_THAN=${DELETE_OLDER_THAN:-2} # 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) @@ -33,7 +33,7 @@ while [ 1 ]; do step "Creating backup of ${db_name} in ${TARGET_FILE}..." mysqldump \ -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 # Dump grants