Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncBash
/
mcBash
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8fe3b59d
authored
Dec 04, 2013
by
Frederick d. Maus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export
1 parent
02040a8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
bin/exportMysql.sh
bin/exportMysql.sh
View file @
8fe3b59
...
...
@@ -10,19 +10,36 @@ mc_h1 $0 $1 $2
if
[
-z
$1
]
;
then
mc_h2
"Abruch bitte geben Sie als ersten Parameter eine Datenbank an"
mc_e
"1 Parameter: Datenbankname"
mc_e
"2 Parameter: Simulationsbit"
mc_e
"3 Parameter: Datenbankbenutzer (default root)"
mc_e
"4 Parameter: Datenbankpasswort"
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
"
mc_e
"
Simulation (bitte geben Sie als zweiten Parameter 1 fuer Programm ausfuehren an)
"
fi
if
[
-z
$3
]
;
then
user
=
'root'
else
user
=
$3
fi
if
[
-z
$4
]
;
then
password
=
' -p '
else
password
=
" --password=
$4
"
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
"mysqldump --single-transaction --default-character-set=utf8 -u
$user
$password
$1
>
$BACKUPFILE
"
$2
mc_bashsu
"tar -czf
$BACKUPFILE
.tar.gz
$BACKUPFILE
"
$2
mc_bashsu
"rm
$BACKUPFILE
"
$2
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment