Commit bad60de0602a51eca7e5ac3af669c84d7b913f36

Authored by veto
1 parent 95483eaa

output only

.gitignore
... ... @@ -4,3 +4,4 @@ config.cfg
4 4 restore.log
5 5 *.bak
6 6 *.zip
  7 +*.txt
... ...
db.txt deleted
1   -{"error":"unauthorized","reason":"You are not authorized to access this db."}
dumper.sh
1 1 #!/bin/bash
2 2 source config.cfg
3 3  
4   -echo $user
5   -echo $pass
  4 +echo $db_user
  5 +echo $db_pass
6 6 echo $server
7 7 echo $port
8 8 echo $database
9   -auth="${user}:${pass}"
  9 +auth="${db_user}:${db_pass}"
10 10 base64=`echo -n $auth | base64`
  11 +curl -H "Accept: application/json" -H "Authorization: Basic $base64" -H "Content-Type: application/json" -s "http://${server}:${port}/${database}/_all_docs?include_docs=true" -o dump.txt
11 12  
12   -#databases2=`curl -X GET http://foo:bar@127.0.0.1:5984/_all_dbs | grep -Po '[A-Za-z0-9_.]*'`
13   -#db in $databases2; do
14   -# curl -X GET http://$COUCHDB/$db/_all_docs\?include_docs\=true | gzip > "$BACKUP_DIR/couchdb/$TIMESTAMP/$db.json.gz"
15   -# done
16   -#echo $auth
17   -#echo $base64
18   -#example
19   -data=$(curl -H "Accept: application/json" -H "Authorization: Basic $base64" -H "Content-Type: application/json" -s "http://${server}:${port}/${database}/_all_docs")
20   -echo $data > test.db
21   -#curl 'http://127.0.0.1:5984/salamander/_all_docs\?include_docs\=true' > db.txt
22 13  
... ...