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
a4944aa2
Commit
a4944aa2
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
couchdb2: remuve unneeded functions
parent
f7f878f6
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
plugins/localdump/couchdb2.sh
+300
-355
300 additions, 355 deletions
plugins/localdump/couchdb2.sh
with
300 additions
and
355 deletions
plugins/localdump/couchdb2.sh
+
300
−
355
View file @
a4944aa2
...
...
@@ -138,50 +138,11 @@ function reqCombined(){
}
# ---------- CONFIG/ INSTANCES
# get valid configured instances
function
getInstances
(){
for
mycfg
in
$(
ls
-1
${
CFGDIR
}
/
*${
1
}*
.config
)
do
if
.
"
$mycfg
"
;
then
echo
$(
basename
"
${
mycfg
}
"
|
cut
-f
1
-d
"."
)
fi
done
}
# load the config of an existing instance
# see getInstances to get valid names
# param string name of the instance to load
function
loadInstance
(){
COUCH_URL
=
if
!
.
"
${
CFGDIR
}
/
${
1
}
.config"
;
then
color error
echo
ERROR: invalid instance:
$1
- the config file cannot be sourced
color reset
exit
1
fi
if
[
-z
"
${
COUCH_URL
}
"
]
;
then
color error
echo
"ERROR: invalid instance:
$1
- the config file has no COUCH_URL"
color reset
exit
1
fi
}
# ---------- BACKUP
# backup with loop over instances
# param 1 string globbing filter to config files
function
doBackup
(){
# # for mycfg in `ls -1 ~/.iml_backup/couchdb/*.config`
# for COUCHDB_INSTANCE in $(getInstances $1)
# do
# loadInstance "$COUCHDB_INSTANCE"
echo
"--- instance:
$PROFILENAME
"
if
curl
--head
-X
GET
"
$COUCH_URL
"
2>/dev/null |
grep
"^HTTP.* 200 "
;
then
...
...
@@ -201,7 +162,6 @@ function doBackup(){
echo
echo
"---
$(
date
)
done."
echo
# done
}
# make backup of all databases in a couchdb instance
...
...
@@ -426,8 +386,6 @@ function restoreByFile(){
echo
# loadInstance $COUCHDB_INSTANCE
if
[
$bFastMode
-eq
0
]
;
then
echo
connect
$couchdbhost
on port
$couchdbport
with user
$couchdbuser
curl
--head
-X
GET
$COUCH_URL
2>/dev/null |
grep
"^HTTP.* 200 "
>
/dev/null
...
...
@@ -501,12 +459,6 @@ function restoreByFile(){
# j_requireProcess "couchdb" 1
# --- very specific :-/ ... check available config files
ls
-1
${
CFGDIR
}
/
*
>
/dev/null 2>&1
rc
=
$rc
+
$?
if
[
$rc
-eq
0
]
;
then
# echo OK: couchdb2 config was found on this system ... checking requirements for backup ...
j_requireBinary
"curl"
1
j_requireBinary
"couchbackup"
1
...
...
@@ -534,17 +486,10 @@ if [ $rc -eq 0 ]; then
fi
else
color error
echo
ERROR: Couchdb is here but I am missing things
for
the backup :-/
color reset
rc
=
1
color.echo error
"ERROR: Your Couchdb data cannot be dumped."
fi
else
rc
=
0
echo
"__DB__
$SERVICENAME
SKIP: couchdb2 config does not seem to be here"
fi
echo
"__DB__
$SERVICENAME
INFO:
$0
$*
[
$SERVICENAME
] final returncode rc=
$rc
"
# --------------------------------------------------------------------------------
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