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 5bdadb10
authored
Dec 07, 2013
by
sn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysqlExport praefix
1 parent
075150c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
bin/ncExportMysql.sh
fnc_mc_echo.inc.sh
bin/ncExportMysql.sh
View file @
5bdadb1
...
@@ -11,11 +11,12 @@
...
@@ -11,11 +11,12 @@
execute
=
1
execute
=
1
logfile
=
"
$__PATH_to_Log
/ncExportMysql.
$1
.log"
logfile
=
"
$__PATH_to_Log
/ncExportMysql.
$1
.log"
mc_e
"
$0
!database! dbuser dbpasswd"
mc_e
"
$0
!database! dbuser dbpasswd
filepreafix
"
mc_e
"
$0
$1
$2
$3
(logfile=
$logfile
)"
mc_e
"
$0
$1
$2
$3
$4
(logfile=
$logfile
)"
mc_parameter
"1"
"1"
"
$1
"
"mysql Datenbank (muss vorhanden sein)"
mc_parameter
"1"
"1"
"
$1
"
"mysql Datenbank (muss vorhanden sein)"
mc_parameter
"2"
"0"
"
$2
"
"Datenbankbenutzer (default root)"
mc_parameter
"2"
"0"
"
$2
"
"Datenbankbenutzer (default root)"
mc_parameter
"3"
"0"
"
$3
"
"Datenbankpasswort "
mc_parameter
"3"
"0"
"
$3
"
"Datenbankpasswort "
mc_parameter
"4"
"0"
"
$4
"
"Datei Praefix "
...
@@ -26,14 +27,19 @@ if [ -z $2 ] ; then
...
@@ -26,14 +27,19 @@ if [ -z $2 ] ; then
fi
fi
if
[
-z
$3
]
;
then
if
[
-z
$3
]
;
then
password
=
' -p '
password
=
' -p '
else
else
password
=
" --password=
$3
"
password
=
" --password=
$3
"
fi
fi
if
[
-z
$4
]
;
then
praefix
=
'db'
else
praefix
=
"
$4
.db"
fi
DATETIME
=
$(
date +
"%Y%m%d_%H%M%S"
)
DATETIME
=
$(
date +
"%Y%m%d_%H%M%S"
)
BACKUPFILE
=
"
mysql
.
$1
.
$DATETIME
.sql"
BACKUPFILE
=
"
$praefix
.
$1
.
$DATETIME
.sql"
mc_bashsu
"mysqldump --single-transaction --default-character-set=utf8 -u
$user
$password
$1
>
$BACKUPFILE
"
$execute
$logfile
mc_bashsu
"mysqldump --single-transaction --default-character-set=utf8 -u
$user
$password
$1
>
$BACKUPFILE
"
$execute
$logfile
mc_bashsu
"tar -czf
$BACKUPFILE
.tar.gz
$BACKUPFILE
"
$execute
$logfile
mc_bashsu
"tar -czf
$BACKUPFILE
.tar.gz
$BACKUPFILE
"
$execute
$logfile
...
...
fnc_mc_echo.inc.sh
View file @
5bdadb1
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
mc_log
()
{
mc_log
()
{
# echo -e $0 $1 $2
# echo -e $0 $1 $2
if
[
-w
$2
]
;
then
if
[
-w
$2
]
;
then
echo
"
$(
date +
"%Y%m%d_%H%M%S"
)
$1
"
>>
$2
datetime
=
$(
date +
"%Y%m%d_%H%M%S"
)
echo
"
$datetime
$1
"
1>>
$2
2>>
$2
.erro
else
else
echo
-e
"bitte
\"
touch
$2
\"
ausführen"
echo
-e
"bitte
\"
touch
$2
\"
ausführen"
fi
fi
...
@@ -47,7 +48,7 @@ mc_bashsu() {
...
@@ -47,7 +48,7 @@ mc_bashsu() {
fi
fi
fi
fi
mc_log
"
$1
"
"
$3
"
#
mc_log "$1" "$3"
}
}
...
...
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