Commit 02040a8b by Frederick d. Maus

mysql export skript

1 parent 882fadfd
#!/bin/bash
__THIS_DIR=$(pwd)'/'
__BASEPATH_EX=$__THIS_DIR
#__BASEPATH_EX='./'
__BASEPATH_EX='/home/dev/mcBash/'
#__BASEPATH_EX='/home/dev/mcBash/'
# __PATH_to_mcBash=$__BASEPATH_EX'include/Lib/Tools/mcBash/'
__PATH_to_mcBash=$__BASEPATH_EX
__PATH_to_Temp=$__PATH_to_mcBash'Temp'
__THIS_DIR=$(pwd)'/'
#!/bin/bash
__THIS_DIR=$(pwd)'/'
__BASEPATH_EX=$__THIS_DIR'../'
#__BASEPATH_EX='./'
#__BASEPATH_EX='/home/dev/mcBash/'
# __PATH_to_mcBash=$__BASEPATH_EX'include/Lib/Tools/mcBash/'
__PATH_to_mcBash=$__BASEPATH_EX
__PATH_to_Temp=$__PATH_to_mcBash'Temp'
#!/bin/bash
#
# @package freeSN
# @author dev@mensch.coop
#
. basepath.inc.sh
. "$__PATH_to_mcBash/include.inc.sh"
mc_h1 $0 $1 $2
if [ -z $1 ] ; then
mc_h2 "Abruch bitte geben Sie als ersten Parameter eine Datenbank an"
exit
fi
if [ -z $2 ] ; then
mc_e "bitte geben Sie als zweiten Parameter 1 oder 0 an: 1 fuer Programm ausfuehren, 0 fuer Programm simulieren"
fi
DATETIME=$(date +"%Y%m%d_%H%M%S")
BACKUPFILE="mysql.$1.$DATETIME.sql"
mc_bashsu "mysqldump --single-transaction --default-character-set=utf8 -u root -p $1 > $BACKUPFILE " $2
mc_bashsu "tar -czf $BACKUPFILE.tar.gz $BACKUPFILE" $2
mc_bashsu "rm $BACKUPFILE" $2
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!