11#! /bin/bash
22
3- printf " This script will download sensitive material to this machine.\n" 1>&2
3+ printf " This script will transmit sensitive material to and from this machine.\n" 1>&2
44read -p " Is this ok [y/N]: " PROMPT
55if [ " ${PROMPT} " != " Y" ] && [ " ${PROMPT} " != " y" ]; then
66 printf " Operation aborted.\n" 1>&2
77 exit 1
88fi
99
10+ SRCDIR=" $( git rev-parse --show-toplevel) "
11+
1012MYSQLHOST=" $1 "
1113if [ -z " ${MYSQLHOST} " ]; then
1214 read -p " Enter the MySQL server hostname: " MYSQLHOST
3638
3739set -e
3840
39- printf " [1/4] Getting path of current project...\n"
40- SRCDIR=" $( git rev-parse --show-toplevel) "
41-
42- printf " [2/4] Creating new backup directory...\n"
41+ printf " [1/3] Creating new backup directory...\n"
4342BKUPDIR=" ${SRCDIR} /tmp/sql-backups/$( date +%Y%m%d-%H%M) "
4443mkdir -v -p " ${BKUPDIR} "
4544
46- printf " [3/4 ] Dumping BNETDocs Redux database...\n"
45+ printf " [2/3 ] Dumping BNETDocs Redux database...\n"
4746mysqldump --host=" ${MYSQLHOST} " --user=" ${MYSQLUSER} " \
4847 --password=" ${MYSQLPASS} " \
4948 --opt --order-by-primary \
@@ -52,7 +51,7 @@ mysqldump --host="${MYSQLHOST}" --user="${MYSQLUSER}" \
5251 --result-file " ${BKUPDIR} /database.redux.sql" \
5352 --databases bnetdocs_botdev
5453
55- printf " [4/4 ] Dumping BNETDocs Phoenix database...\n"
54+ printf " [3/3 ] Dumping BNETDocs Phoenix database...\n"
5655mysqldump --host=" ${MYSQLHOST} " --user=" ${MYSQLUSER} " \
5756 --password=" ${MYSQLPASS} " \
5857 --opt --order-by-primary \
0 commit comments