1
1
#! /bin/bash
2
2
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
4
4
read -p " Is this ok [y/N]: " PROMPT
5
5
if [ " ${PROMPT} " != " Y" ] && [ " ${PROMPT} " != " y" ]; then
6
6
printf " Operation aborted.\n" 1>&2
7
7
exit 1
8
8
fi
9
9
10
+ SRCDIR=" $( git rev-parse --show-toplevel) "
11
+
10
12
MYSQLHOST=" $1 "
11
13
if [ -z " ${MYSQLHOST} " ]; then
12
14
read -p " Enter the MySQL server hostname: " MYSQLHOST
36
38
37
39
set -e
38
40
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"
43
42
BKUPDIR=" ${SRCDIR} /tmp/sql-backups/$( date +%Y%m%d-%H%M) "
44
43
mkdir -v -p " ${BKUPDIR} "
45
44
46
- printf " [3/4 ] Dumping BNETDocs Redux database...\n"
45
+ printf " [2/3 ] Dumping BNETDocs Redux database...\n"
47
46
mysqldump --host=" ${MYSQLHOST} " --user=" ${MYSQLUSER} " \
48
47
--password=" ${MYSQLPASS} " \
49
48
--opt --order-by-primary \
@@ -52,7 +51,7 @@ mysqldump --host="${MYSQLHOST}" --user="${MYSQLUSER}" \
52
51
--result-file " ${BKUPDIR} /database.redux.sql" \
53
52
--databases bnetdocs_botdev
54
53
55
- printf " [4/4 ] Dumping BNETDocs Phoenix database...\n"
54
+ printf " [3/3 ] Dumping BNETDocs Phoenix database...\n"
56
55
mysqldump --host=" ${MYSQLHOST} " --user=" ${MYSQLUSER} " \
57
56
--password=" ${MYSQLPASS} " \
58
57
--opt --order-by-primary \
0 commit comments