From 9c203510514cecc8f26da032e9abbbe7a0ea59b1 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 16 Dec 2013 15:44:10 +0000 Subject: encode slash in dbname, include attachments in dump --- couchdb_functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchdb_functions b/couchdb_functions index 4b47f5d..8330708 100644 --- a/couchdb_functions +++ b/couchdb_functions @@ -69,7 +69,7 @@ dump_db () { # curl_opts='--netrc-file /etc/couchdb/couchdb.netrc' #read -a docs <<< `curl $curl_opts -sS 127.0.0.1:5984/$db/_all_docs | json_pp | sed -ne 's/"id" : "//p' | sed -e 's/",//'` - read -a docs <<< `wget $WGET_OPTS 127.0.0.1:5984/$db/_all_docs | json_pp | sed -ne 's/"id" : "//p' | sed -e 's/",//'` + read -a docs <<< `wget $WGET_OPTS 127.0.0.1:5984/$db/_all_docs | json_pp | sed -ne 's/"id" : "//p' | sed -e 's/",//;s/\//%2F/'` count=${#docs[*]} last=${docs[$(( count - 1 ))]} @@ -80,7 +80,7 @@ dump_db () { for id in "${docs[@]}" do # curl $curl_opts -sS 127.0.0.1:5984/$db/$id - wget $WGET_OPTS 127.0.0.1:5984/$db/$id + wget $WGET_OPTS 127.0.0.1:5984/$db/$id?attachments=true if [[ $id != $last ]] then echo ',' -- cgit v1.2.3