From 436ce974d1bb902dfab9e52a5f791037d9052445 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Mon, 12 Jun 2017 01:39:21 +1000 Subject: [PATCH] backup-mysql: fixed directory --- backup-mysql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backup-mysql b/backup-mysql index fa86056..2b66f0a 100755 --- a/backup-mysql +++ b/backup-mysql @@ -1,9 +1,10 @@ #!/bin/bash -DATABASES="$(echo 'show databases' | mysql | tail -n+2)" +set -eu -cd ~/backup +cd ~/backup-mysql/ +DATABASES="$(echo 'show databases' | mysql | tail -n+2)" for db in ${DATABASES}; do mysqldump --add-drop-table --single-transaction "${db}" | \ gzip -9 > "${db}-$(date '+%Y%m%d').sql.gz" -- 2.39.2