Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
99ce1c42
Commit
99ce1c42
authored
1 year ago
by
Axel Hahn
Browse files
Options
Downloads
Patches
Plain Diff
show count of found database profiles and a message on 0 profiles
parent
f0b33915
No related branches found
No related tags found
1 merge request
!129
Db Profiles
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
localdump.sh
+12
-6
12 additions, 6 deletions
localdump.sh
with
12 additions
and
6 deletions
localdump.sh
+
12
−
6
View file @
99ce1c42
...
@@ -408,7 +408,7 @@ EOH
...
@@ -408,7 +408,7 @@ EOH
# . /usr/local/bin/inc_cronfunctions.sh
# . /usr/local/bin/inc_cronfunctions.sh
j_requireUser
"root"
j_requireUser
"root"
h1
$(
date
)
IML BACKUP :: LOCALDUMP
::
$*
h1
$(
date
)
IML BACKUP :: LOCALDUMP
export
SERVICENAME
=
$1
export
SERVICENAME
=
$1
...
@@ -432,13 +432,18 @@ EOH
...
@@ -432,13 +432,18 @@ EOH
if
[
"
$1
"
=
"ALL"
]
||
[
-z
"
$1
"
]
;
then
if
[
"
$1
"
=
"ALL"
]
||
[
-z
"
$1
"
]
;
then
profiles2run
=
$(
get_database_profiles
)
profiles2run
=
$(
get_database_profiles
)
echo
AUT
O:
c
alling
local
backup scripts
for
all active profiles
echo
"INF
O:
C
alling local backup scripts for all active profiles
"
echo
"
$profiles2run
"
|
nl
echo
"
$profiles2run
"
|
nl
echo
else
else
profiles2run
=
$*
profiles2run
=
$*
echo
"INFO: I try to dump the profiles you gave as parameter:
$profiles2run
"
echo
fi
fi
iProfilesFound
=
$(
grep
-c
.
<<<
"
$profiles2run
"
)
test
"
$iProfilesFound
"
-eq
"0"
&&
echo
"INFO: No match - no database dumps needed."
typeset
-i
iProfileCounter
=
0
# ----- GO
# ----- GO
# PROFILENAME mysql_localhost_13306
# PROFILENAME mysql_localhost_13306
# SERVICENAME mysql
# SERVICENAME mysql
...
@@ -446,9 +451,10 @@ EOH
...
@@ -446,9 +451,10 @@ EOH
for
PROFILENAME
in
$profiles2run
for
PROFILENAME
in
$profiles2run
do
do
iProfileCounter+
=
1
if
dbdetect.setProfile
"
${
PROFILENAME
}
"
;
then
if
dbdetect.setProfile
"
${
PROFILENAME
}
"
;
then
h2
"START PROFILE [
${
PROFILENAME
}
]"
h2
"START PROFILE
$iProfileCounter
of
$iProfilesFound
[
${
PROFILENAME
}
]"
SERVICENAME
=
$(
dbdetect.getType
"
$PROFILENAME
"
)
SERVICENAME
=
$(
dbdetect.getType
"
$PROFILENAME
"
)
BACKUP_PARAMS
=
$(
dbdetect.getParams
)
BACKUP_PARAMS
=
$(
dbdetect.getParams
)
...
@@ -480,7 +486,7 @@ EOH
...
@@ -480,7 +486,7 @@ EOH
else
else
echo
"SKIP: profile '
$PROFILENAME
' "
echo
"SKIP: profile
$iProfileCounter
of
$iProfilesFound
'
$PROFILENAME
' "
# see why it is not active
# see why it is not active
DBD_DEBUG
=
1
;
dbdetect.setProfile
"
${
PROFILENAME
}
"
;
echo
;
DBD_DEBUG
=
0
DBD_DEBUG
=
1
;
dbdetect.setProfile
"
${
PROFILENAME
}
"
;
echo
;
DBD_DEBUG
=
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment