summaryrefslogtreecommitdiff
path: root/couchdb_restoreall.sh
blob: 387b9017d95b5254cfb8c098e27a06b84fad6648 (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