summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-12-16 12:59:00 +0000
committervarac <varacanero@zeromail.org>2013-12-16 12:59:00 +0000
commit77fb5be8e4273686d98146b0fa0d9612ab879e6d (patch)
tree769fd7a99d19e70c029a56c1bcd32a0665bba2fd
parentf81ab8e3c41e74c83db9671722569f7322c94996 (diff)
updated couchdb_restoreall.sh to match new restore routine
-rwxr-xr-xcouchdb_restoreall.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/couchdb_restoreall.sh b/couchdb_restoreall.sh
index 37bdccf..7f3f1db 100755
--- a/couchdb_restoreall.sh
+++ b/couchdb_restoreall.sh
@@ -1,15 +1,23 @@
#!/bin/bash
-# dump_db() and restore_db() rely on python-couchdb package,
-# python-couchdb =< 0.8-1 needs to be patched, see
-# http://code.google.com/p/couchdb-python/issues/detail?id=194
-
. couchdb_scripts_defaults.conf
. couchdb_functions
-dbs="`get_dbs $URL`"
+dumpdir=/tmp/restore # only for debugging
+[ -z $dumpdir ] && dumpdir='/var/backups/couchdb'
+
+dbs=`find $dumpdir -type f '!' -name '*_security'`
for db in $dbs
do
- restore_db ${URL} $db $couchdb_user $couchdb_pw
+ db_name=`basename $db`
+
+ if [[ " $EXCLUDE_DBS " == *\ $db_name\ * ]]
+ then
+ echo "NOT restoring $db_name, cause it is in the list of excluded DBs"
+ else
+ echo "Restoring $db_name"
+ restore_db ${URL} $db_name $dumpdir
+ fi
+ echo
done