summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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