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
Merge requests
!129
Db Profiles
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Db Profiles
db-detector
into
master
Overview
0
Commits
63
Pipelines
0
Changes
1
Merged
Db Profiles
Hahn Axel (hahn)
requested to merge
db-detector
into
master
Feb 20, 2024
Overview
0
Commits
63
Pipelines
0
Changes
1
0
0
Merge request reports
Viewing commit
99ce1c42
Prev
Next
Show latest version
1 file
+
12
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
99ce1c42
show count of found database profiles and a message on 0 profiles
· 99ce1c42
Axel Hahn
authored
Mar 14, 2024
localdump.sh
+
12
−
6
View file @ 99ce1c42
Edit in single-file editor
Open in Web IDE
Show full file
@@ -408,7 +408,7 @@ EOH
# . /usr/local/bin/inc_cronfunctions.sh
j_requireUser
"root"
h1
$(
date
)
IML BACKUP :: LOCALDUMP
::
$*
h1
$(
date
)
IML BACKUP :: LOCALDUMP
export
SERVICENAME
=
$1
@@ -432,13 +432,18 @@ EOH
if
[
"
$1
"
=
"ALL"
]
||
[
-z
"
$1
"
]
;
then
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
else
profiles2run
=
$*
echo
"INFO: I try to dump the profiles you gave as parameter:
$profiles2run
"
echo
fi
iProfilesFound
=
$(
grep
-c
.
<<<
"
$profiles2run
"
)
test
"
$iProfilesFound
"
-eq
"0"
&&
echo
"INFO: No match - no database dumps needed."
typeset
-i
iProfileCounter
=
0
# ----- GO
# PROFILENAME mysql_localhost_13306
# SERVICENAME mysql
@@ -446,9 +451,10 @@ EOH
for
PROFILENAME
in
$profiles2run
do
iProfileCounter+
=
1
if
dbdetect.setProfile
"
${
PROFILENAME
}
"
;
then
h2
"START PROFILE [
${
PROFILENAME
}
]"
h2
"START PROFILE
$iProfileCounter
of
$iProfilesFound
[
${
PROFILENAME
}
]"
SERVICENAME
=
$(
dbdetect.getType
"
$PROFILENAME
"
)
BACKUP_PARAMS
=
$(
dbdetect.getParams
)
@@ -480,7 +486,7 @@ EOH
else
echo
"SKIP: profile '
$PROFILENAME
' "
echo
"SKIP: profile
$iProfileCounter
of
$iProfilesFound
'
$PROFILENAME
' "
# see why it is not active
DBD_DEBUG
=
1
;
dbdetect.setProfile
"
${
PROFILENAME
}
"
;
echo
;
DBD_DEBUG
=
0
Loading