summaryrefslogtreecommitdiff
path: root/couchdb_restoreall.sh
blob: 7f3f1dbf9c42991393a6a1d7c927118a65a5962b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

. couchdb_scripts_defaults.conf
. couchdb_functions

dumpdir=/tmp/restore  # only for debugging
[ -z $dumpdir ] && dumpdir='/var/backups/couchdb'

dbs=`find $dumpdir -type f '!' -name '*_security'`

for db in $dbs
do
  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