Files
Daniel Cortés 365db38212 Tecnicamente esto es la version final ya
No hay mucho ams que hacer,  la entrega es en una hora aprox
2019-07-09 18:48:04 -04:00

26 lines
565 B
Bash
Executable File

#!/bin/sh
if [ -z "$1" ]; then
echo "Se debe pasar el nombre de la base de datos"
exit 1
fi
1>&2 printf "Enter password: "
stty_orig=$(stty -g) # save original terminal setting
stty -echo # turn-off echoing.
read -r PASS # read the password
stty "${stty_orig}" # restore terminal setting.
1>&2 printf "\n"
set -e
dump=$(mysqldump -u root -p${PASS} --compact --hex-blob -t "$1")
echo "start transaction;"
echo "set foreign_key_checks = 0;"
echo "set autocommit = 0;"
echo ${dump}
echo "set autocommit = 1;"
echo "set foreign_key_checks = 1;"
echo "commit;"