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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
e20c1b6c
Commit
e20c1b6c
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
shell fixes; output for couchdb2, ldap
parent
b58c8778
Branches
Branches containing commit
No related tags found
1 merge request
!54
shell fixes; output for couchdb2, ldap
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
inc_bash.sh
+6
-1
6 additions, 1 deletion
inc_bash.sh
localdump.sh
+1
-6
1 addition, 6 deletions
localdump.sh
plugins/localdump/couchdb2.sh
+1
-1
1 addition, 1 deletion
plugins/localdump/couchdb2.sh
plugins/localdump/ldap.sh
+16
-16
16 additions, 16 deletions
plugins/localdump/ldap.sh
with
24 additions
and
24 deletions
inc_bash.sh
+
6
−
1
View file @
e20c1b6c
...
@@ -15,8 +15,13 @@ typeset -i rc=0
...
@@ -15,8 +15,13 @@ typeset -i rc=0
# It stores the last exitcode in myrc
# It stores the last exitcode in myrc
function
fetchrc
(){
function
fetchrc
(){
myrc
=
$?
myrc
=
$?
echo
rc
=
$myrc
rc
=
$rc
+
$myrc
rc
=
$rc
+
$myrc
if
[
$myrc
-eq
0
]
;
then
cecho ok
"OK"
else
cecho error
"FAILED (rc=
$myrc
)"
fi
}
}
...
...
This diff is collapsed.
Click to expand it.
localdump.sh
+
1
−
6
View file @
e20c1b6c
...
@@ -89,12 +89,7 @@
...
@@ -89,12 +89,7 @@
if
[
$myrc
-eq
0
]
;
then
if
[
$myrc
-eq
0
]
;
then
echo
-n
"gzip
$1
... "
echo
-n
"gzip
$1
... "
gzip
-9
-f
"
${
1
}
"
gzip
-9
-f
"
${
1
}
"
fetchrc
>
/dev/null
fetchrc
if
[
$myrc
-eq
0
]
;
then
cecho ok
"OK"
else
cecho error
"FAILED"
fi
else
else
cecho error
"ERROR occured while dumping - no gzip of
$_outfile
"
cecho error
"ERROR occured while dumping - no gzip of
$_outfile
"
fi
fi
...
...
This diff is collapsed.
Click to expand it.
plugins/localdump/couchdb2.sh
+
1
−
1
View file @
e20c1b6c
...
@@ -223,7 +223,7 @@ function _doBackupOfSingleInstance(){
...
@@ -223,7 +223,7 @@ function _doBackupOfSingleInstance(){
fi
fi
done
done
rm
-f
"
$dblist
"
rm
-f
"
$dblist
"
echo
"__DB__
$SERVICENAME
INFO:
${
COUCHDB_INSTANCE
}
- backed up
$iDbCount
dbs of
$iDbTotal
total"
echo
"__DB__
$SERVICENAME
backup
INFO:
${
COUCHDB_INSTANCE
}
- backed up
$iDbCount
dbs of
$iDbTotal
total"
}
}
...
...
This diff is collapsed.
Click to expand it.
plugins/localdump/ldap.sh
+
16
−
16
View file @
e20c1b6c
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
# ================================================================================
# ================================================================================
if
[
-z
$BACKUP_TARGETDIR
]
;
then
if
[
-z
"
$BACKUP_TARGETDIR
"
]
;
then
echo
ERROR: you cannot start
`
basename
$0
`
directly
echo
ERROR: you cannot start
$(
basename
$0
)
directly
rc
=
$rc
+1
rc
=
$rc
+1
exit
1
exit
1
fi
fi
...
@@ -53,14 +53,14 @@ function dump_ldap(){
...
@@ -53,14 +53,14 @@ function dump_ldap(){
DN
=
$1
DN
=
$1
DUMPFILE
=
$2
DUMPFILE
=
$2
slapcat
-F
$LDAP_CONF_DIR_PATH
-b
$DN
-l
$DUMPFILE
echo
-n
"__DB__
$SERVICENAME
backup
$LDAP_CONF_DIR_PATH
.. DN
$DN
"
fetchrc
slapcat
-F
$LDAP_CONF_DIR_PATH
-b
"
$DN
"
-l
"
$DUMPFILE
"
fetchrc
>
/dev/null
if
[
$rc
-ne
0
]
;
then
if
[
$
my
rc
-ne
0
]
;
then
echo
ERROR during backup
$LDAP_CONF_DIR_PATH
with DN
$DN
echo
"
ERROR during backup
"
else
else
echo
Dump OK
db._compressDumpfile
"
$DUMPFILE
"
compress_file
$DUMPFILE
fi
fi
}
}
...
@@ -73,30 +73,30 @@ function doLdapBackup(){
...
@@ -73,30 +73,30 @@ function doLdapBackup(){
echo
-----
LDAP BACKUP CONFIG
echo
-----
LDAP BACKUP CONFIG
# for cfgname in `ldapsearch -H ldap:// -x -s base -b "" -LLL "configContext" | grep "configContext" | cut -f 2 -d ":"`
# for cfgname in `ldapsearch -H ldap:// -x -s base -b "" -LLL "configContext" | grep "configContext" | cut -f 2 -d ":"`
for
cfgname
in
`
ldapsearch
-Y
EXTERNAL
-H
ldapi:///
-s
base
-b
''
-LLL
configContext |
grep
"configContext"
|
cut
-f
2
-d
":"
`
for
cfgname
in
$(
ldapsearch
-Y
EXTERNAL
-H
ldapi:///
-s
base
-b
''
-LLL
configContext |
grep
"configContext"
|
cut
-f
2
-d
":"
)
do
do
echo
DN
$cfgname
echo
DN
$cfgname
cfg2
=
`
echo
$cfgname
|
sed
"s#[
\
=,]#_#g"
`
cfg2
=
$(
echo
$cfgname
|
sed
"s#[
\
=,]#_#g"
)
outfile
=
$(
hostname
)
_ldap_olc_config__
`
get_outfile
${
cfg2
}
`
.ldif
outfile
=
$(
hostname
)
_ldap_olc_config__
$(
get_outfile
${
cfg2
}
)
.ldif
dump_ldap
$cfgname
$BACKUP_TARGETDIR
/
$outfile
dump_ldap
"
$cfgname
"
"
$BACKUP_TARGETDIR
/
$outfile
"
done
done
echo
-----
LDAP DATA
echo
-----
LDAP DATA
#for cfgname in `ldapsearch -H ldap:// -x -s base -b "" -LLL "namingContexts" | grep "namingContexts" | cut -f 2 -d ":"`
#for cfgname in `ldapsearch -H ldap:// -x -s base -b "" -LLL "namingContexts" | grep "namingContexts" | cut -f 2 -d ":"`
for
cfgname
in
`
ldapsearch
-Y
EXTERNAL
-H
ldapi:///
-s
base
-b
""
-LLL
"namingContexts"
|
grep
"namingContexts"
|
cut
-f
2
-d
":"
`
for
cfgname
in
$(
ldapsearch
-Y
EXTERNAL
-H
ldapi:///
-s
base
-b
""
-LLL
"namingContexts"
|
grep
"namingContexts"
|
cut
-f
2
-d
":"
)
do
do
echo
DN
$cfgname
echo
DN
$cfgname
cfg2
=
`
echo
$cfgname
|
sed
"s#[
\
=,]#_#g"
`
cfg2
=
`
echo
$cfgname
|
sed
"s#[
\
=,]#_#g"
`
outfile
=
$(
hostname
)
_ldap_data__
`
get_outfile
${
cfg2
}
`
.ldif
outfile
=
$(
hostname
)
_ldap_data__
$(
get_outfile
${
cfg2
}
)
.ldif
dump_ldap
$cfgname
$BACKUP_TARGETDIR
/
$outfile
dump_ldap
"
$cfgname
"
"
$BACKUP_TARGETDIR
/
$outfile
"
done
done
echo
echo
echo
-----
DUMPS
echo
-----
DUMPS
ls
-l
$BACKUP_TARGETDIR
/
*
$BACKUP_DATE
*
ls
-l
"
$BACKUP_TARGETDIR
/*
$BACKUP_DATE
*
"
}
}
...
...
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