Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
9338e7e7
Commit
9338e7e7
authored
Jul 11, 2015
by
woogerboy21
Browse files
Added -e option
Added -e option by request Updated process checking method to allow -e option
parent
10019bf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
servatrice/scripts/db_backup_all
View file @
9338e7e7
#!/bin/bash
#!/bin/bash
set
-u
set
-u
set
-e
SLEEPTIME
=
5
SLEEPTIME
=
5
SQLCONFFILE
=
"./mysql.cnf"
#set this to the path that contains the mysql.cnf file
SQLCONFFILE
=
"./mysql.cnf"
#set this to the path that contains the mysql.cnf file
LOGAPPENDDATE
=
`
date
+%m%d%Y
`
LOGAPPENDDATE
=
`
date
+%m%d%Y
`
...
@@ -30,8 +31,7 @@ TABLES=(
...
@@ -30,8 +31,7 @@ TABLES=(
)
)
PROCESSNAME
=
"mysqldump"
PROCESSNAME
=
"mysqldump"
COMMANDRESULTS
=
`
ps
-e
|grep
$PROCESSNAME
|grep
-v
grep
`
if
[
"
$(
pgrep
$PROCESSNAME
)
"
==
""
]
;
if
[
-z
"
$COMMANDRESULTS
"
]
;
then
then
[
!
-d
$BACKUPDIR
]
&&
mkdir
-p
$BACKUPDIR
/
[
!
-d
$BACKUPDIR
]
&&
mkdir
-p
$BACKUPDIR
/
for
TABLENAME
in
"
${
TABLES
[@]
}
"
for
TABLENAME
in
"
${
TABLES
[@]
}
"
...
...
servatrice/scripts/db_restore_all
View file @
9338e7e7
#!/bin/bash
#!/bin/bash
set
-u
set
-u
set
-e
SLEEPTIME
=
5
SLEEPTIME
=
5
SQLCONFFILE
=
"./mysql.cnf"
#set this to the path that contains the mysql.cnf file
SQLCONFFILE
=
"./mysql.cnf"
#set this to the path that contains the mysql.cnf file
LOGAPPENDDATE
=
`
date
+%m%d%Y
`
LOGAPPENDDATE
=
`
date
+%m%d%Y
`
...
@@ -30,8 +31,7 @@ TABLES=(
...
@@ -30,8 +31,7 @@ TABLES=(
)
)
PROCESSNAME
=
"mysqldump"
PROCESSNAME
=
"mysqldump"
COMMANDRESULTS
=
`
ps
-e
|grep
$PROCESSNAME
|grep
-v
grep
`
if
[
"
$(
pgrep
$PROCESSNAME
)
"
==
""
]
;
if
[
-z
"
$COMMANDRESULTS
"
]
;
then
then
[
!
-d
$BACKUPDIR
]
&&
mkdir
-p
$BACKUPDIR
/
[
!
-d
$BACKUPDIR
]
&&
mkdir
-p
$BACKUPDIR
/
for
TABLENAME
in
"
${
TABLES
[@]
}
"
for
TABLENAME
in
"
${
TABLES
[@]
}
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
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 comment