docker-images/pluie/alpine-mysql/dbdump.sh
a-sansara e185c732dc mysql : add various scripts
all   : fix terminal ENV context and add doc nav
2016-08-03 01:38:18 +02:00

24 lines
453 B
Bash
Executable File

#!/bin/bash
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
. /scripts/dbcommon.sh
dbname=${1:-''}
shname=$(basename $0)
echoTitle
function usage(){
echo -e "\n ${Cusa}usage :${Coff}\n ${Ctext}$shname \t${Copt}DBNAME USER${Coff}"
}
if [ ! -z "$1" ]; then
mysqldump -uroot "$dbname" > "/dump/"$(date +"%y%m%d-%H%I")".$dbname.sql"
if [ $? -eq 0 ]; then
echo -e "\n done"
fi
echo
else
errEmptyDb
fi