From c736d1b1a0d14ee60024d2a50128a51efe5c5028 Mon Sep 17 00:00:00 2001 From: Denis Kopylov Date: Fri, 19 Feb 2021 14:15:33 +0300 Subject: [PATCH 1/3] Add warden db dump command --- commands/db.cmd | 4 ++++ commands/db.help | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/commands/db.cmd b/commands/db.cmd index 19711061..d00cdb1f 100644 --- a/commands/db.cmd +++ b/commands/db.cmd @@ -39,6 +39,10 @@ case "${WARDEN_PARAMS[0]}" in | "${WARDEN_DIR}/bin/warden" env exec -T db \ mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" --database="${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" ;; + dump) + "${WARDEN_DIR}/bin/warden" env exec -T db \ + mysqldump -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" | pv | gzip > "${WARDEN_PARAMS[@]:1}" "$@" + ;; *) fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." ;; diff --git a/commands/db.help b/commands/db.help index dbbe4db1..1bd449e5 100755 --- a/commands/db.help +++ b/commands/db.help @@ -9,7 +9,8 @@ WARDEN_USAGE=$(cat < Create database dump and put it into specified file EOF ) From 1d01b1ffab2fb73936426f6ed7d3dca32512d29e Mon Sep 17 00:00:00 2001 From: Denis Kopylov Date: Tue, 23 Feb 2021 12:29:19 +0300 Subject: [PATCH 2/3] Update commands/db.cmd Co-authored-by: David Alger --- commands/db.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/db.cmd b/commands/db.cmd index d00cdb1f..fae152b5 100644 --- a/commands/db.cmd +++ b/commands/db.cmd @@ -41,7 +41,7 @@ case "${WARDEN_PARAMS[0]}" in ;; dump) "${WARDEN_DIR}/bin/warden" env exec -T db \ - mysqldump -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" | pv | gzip > "${WARDEN_PARAMS[@]:1}" "$@" + mysqldump -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "${WARDEN_PARAMS[@]:1}" "$@" ;; *) fatal "The command \"${WARDEN_PARAMS[0]}\" does not exist. Please use --help for usage." From ff0b6e8cd523c12bdc17400a5fbe537f6f084998 Mon Sep 17 00:00:00 2001 From: Denis Kopylov Date: Tue, 23 Feb 2021 12:29:25 +0300 Subject: [PATCH 3/3] Update commands/db.help Co-authored-by: David Alger --- commands/db.help | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/db.help b/commands/db.help index 1bd449e5..1eba2e81 100755 --- a/commands/db.help +++ b/commands/db.help @@ -11,6 +11,6 @@ WARDEN_USAGE=$(cat < Create database dump and put it into specified file + dump Dumps database from db container via mysqldump EOF )