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
5050
5151 mkdir -p /vagrant/sql
5252
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}
5454
5555 result=" $? "
5656
@@ -68,6 +68,7 @@ if [[ "$*" == *"--echo-filename"* ]]; then
6868
6969fi
7070
71+ echo_if_not_quiet " $* " , " =Database backed up."
7172
7273
7374
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ if [ "${bakfile}" == "${importfile}" ]; then
4646
4747fi
4848
49- echo_if_not_quiet " $* " , " ^ Backing up database..."
49+ echo_if_not_quiet " $* " , " = Backing up database..."
5050
5151bakfile=$( box backup-db --quiet --echo-filename)
5252
@@ -64,11 +64,18 @@ if [[ "$*" == *" error "* ]]; then
6464
6565fi
6666
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."
6874
6975echo_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."
7078
71- mysql -u wordpress -pwordpress wordpress < ${importfile}
7279
7380
7481
You can’t perform that action at this time.
0 commit comments