Skip to content
Snippets Groups Projects
Commit a4944aa2 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

couchdb2: remuve unneeded functions

parent f7f878f6
No related branches found
No related tags found
1 merge request!129Db Profiles
......@@ -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"
# --------------------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment