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 82870d5b
authored
Dec 05, 2013
by
sn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
1 parent
aca53ec1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
18 deletions
basepath.inc.sh
basepath.inc.sh_ausserhalb_wenn_mcBash_in_home_dev
bin/basepath.inc.sh
bin/ncExportMysql.sh
fnc_mc_echo.inc.sh
basepath.inc.sh
View file @
82870d5
...
...
@@ -7,3 +7,4 @@ __BASEPATH_EX=$__THIS_DIR
# __PATH_to_mcBash=$__BASEPATH_EX'include/Lib/Tools/mcBash/'
__PATH_to_mcBash
=
$__BASEPATH_EX
__PATH_to_Temp
=
$__PATH_to_mcBash
'Temp'
__PATH_to_Log
=
$__PATH_to_mcBash
'/log'
\ No newline at end of file
basepath.inc.sh_ausserhalb_wenn_mcBash_in_home_dev
View file @
82870d5
...
...
@@ -6,3 +6,4 @@ __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'
__PATH_to_Log
=
$__PATH_to_mcBash
'/log'
\ No newline at end of file
bin/basepath.inc.sh
View file @
82870d5
...
...
@@ -7,3 +7,4 @@ __BASEPATH_EX=$__THIS_DIR'../'
# __PATH_to_mcBash=$__BASEPATH_EX'include/Lib/Tools/mcBash/'
__PATH_to_mcBash
=
$__BASEPATH_EX
__PATH_to_Temp
=
$__PATH_to_mcBash
'Temp'
__PATH_to_Log
=
$__PATH_to_mcBash
'/log'
bin/ncExportMysql.sh
View file @
82870d5
...
...
@@ -9,6 +9,7 @@
.
"
$__PATH_to_mcBash
/include.inc.sh"
execute
=
1
logfile
=
"
$__PATH_to_Log
/
$1
.log"
mc_h1
$0
$1
$2
mc_parameter
"1"
"1"
"
$1
"
"mysql Datenbank (muss vorhanden sein)"
...
...
@@ -16,6 +17,7 @@ mc_parameter "2" "0" "$2" "Datenbankbenutzer (default root)"
mc_parameter
"3"
"0"
"
$3
"
"Datenbankpasswort "
if
[
-z
$2
]
;
then
user
=
'root'
else
...
...
@@ -32,6 +34,6 @@ fi
DATETIME
=
$(
date +
"%Y%m%d_%H%M%S"
)
BACKUPFILE
=
"mysql.
$1
.
$DATETIME
.sql"
mc_bashsu
"mysqldump --single-transaction --default-character-set=utf8 -u
$user
$password
$1
>
$BACKUPFILE
"
$execute
mc_bashsu
"tar -czf
$BACKUPFILE
.tar.gz
$BACKUPFILE
"
$execute
mc_bashsu
"rm
$BACKUPFILE
"
$execute
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
"rm
$BACKUPFILE
"
$execute
$logfile
fnc_mc_echo.inc.sh
View file @
82870d5
#!/bin/bash
#
# @param string $1 string to log
# @param string $2 logfile (FILE exists and is writable)
#
mc_log
()
{
if
[
-w
$2
]
;
then
echo
"
$(
date +
"%Y%m%d_%H%M%S"
)
$1
"
>>
$2
fi
}
mc_h1
()
{
echo
-e
'\n###############'
echo
-e
"
$1
"
echo
-e
'###############'
}
mc_h2
()
{
echo
-e
"
\n
$1
"
echo
-e
'###############'
}
#
# @param string $1 string to print (echo)
# @param string $2 logfile (FILE exists and is writable)
#
mc_e
()
{
echo
-e
"
\n
$1
"
mc_log
$1
$2
}
#
# Funktion zur Ausgabe von bash Befehlen
# @param string $1 - Parameter wird im bash Format ausgegeben
# @param bool $2 - wenn $2=1 dann wird $1 ausgeführt
# @param string $3 - logfile, wenn dann wird befehl zusaetzlich in logfile geschrieben (FILE exists and is writable)
#
mc_bashsu
()
{
echo
-e
"#
$1
"
...
...
@@ -13,6 +44,9 @@ mc_bashsu() {
eval
$1
fi
fi
mc_log
$1
$3
}
#
...
...
@@ -32,17 +66,3 @@ mc_mysql () {
mc_bashsu
"rmdir mc_mysql_tmp"
1
}
mc_h1
()
{
echo
-e
'\n###############'
echo
-e
"
$1
"
echo
-e
'###############'
}
mc_h2
()
{
echo
-e
"
\n
$1
"
echo
-e
'###############'
}
mc_e
()
{
echo
-e
"
\n
$1
"
}
\ No newline at end of file
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