This repository was archived by the owner on Jan 25, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ if [ $dryrun -eq 0 ]; then
50
50
51
51
mkdir -p /vagrant/sql
52
52
53
- mysqldump -u wordpress -pwordpress wordpress > ${bakfile}
53
+ mysqldump -u wordpress -pwordpress wordpress 2>&1 | grep -v " Warning: Using a password on the command line interface can be insecure. " > ${bakfile}
54
54
55
55
result=" $? "
56
56
@@ -68,6 +68,7 @@ if [[ "$*" == *"--echo-filename"* ]]; then
68
68
69
69
fi
70
70
71
+ echo_if_not_quiet " $* " , " =Database backed up."
71
72
72
73
73
74
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ if [ "${bakfile}" == "${importfile}" ]; then
46
46
47
47
fi
48
48
49
- echo_if_not_quiet " $* " , " ^ Backing up database..."
49
+ echo_if_not_quiet " $* " , " = Backing up database..."
50
50
51
51
bakfile=$( box backup-db --quiet --echo-filename)
52
52
@@ -64,11 +64,18 @@ if [[ "$*" == *" error "* ]]; then
64
64
65
65
fi
66
66
67
- echo_if_not_quiet " $* " , " ^Database backed-up to ${bakfile} ..."
67
+ echo_if_not_quiet " $* " , " ^Database backed-up to ${bakfile} ."
68
+
69
+ echo_if_not_quiet " $* " , " =Dropping any prior tables..."
70
+ mysql -u wordpress -pwordpress -Nse " show tables;" wordpress 2>&1 | grep -v " Warning:" > /tmp/mysql-table-list.txt
71
+ cat /tmp/mysql-table-list.txt | while read table; do mysql -u wordpress -pwordpress -e " drop table $table " wordpress 2>&1 | grep -v " Warning:" ; done
72
+ rm /tmp/mysql-table-list.txt
73
+ echo_if_not_quiet " $* " , " ^Tables dropped."
68
74
69
75
echo_if_not_quiet " $* " , " =Importing database from ${importfile} ..."
76
+ mysql -u wordpress -pwordpress wordpress < ${importfile} 2>&1 | grep -v " Warning:"
77
+ echo_if_not_quiet " $* " , " =Database imported."
70
78
71
- mysql -u wordpress -pwordpress wordpress < ${importfile}
72
79
73
80
74
81
You can’t perform that action at this time.
0 commit comments