From 77fb5be8e4273686d98146b0fa0d9612ab879e6d Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 16 Dec 2013 12:59:00 +0000 Subject: updated couchdb_restoreall.sh to match new restore routine --- couchdb_restoreall.sh | 20 ++++++++++++++------ 1 file 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 -- cgit v1.2.3