Skip to navigation
Bash script to init couchdb slave databases from a master
23.01.18
#!/bin/bash #this will connect to a remote couchdb, get all its databases and create on the local couchdb the replication docs TARGET='http://127.0.0.1:5984' TARGET2='http://127.0.0.1:6984' TARGET_PASS='foo:bar' TARGET_USER='foo' MASTER='https://couchdb.myserver.com' MASTER_PASS='foo:bar' PASS_MASTER=`echo -n $MASTER_PASS | base64` PASS_TARGET=`echo -n $TARGET_PASS | base64` dbs=$(curl -H "Authorization: Basic $PASS_MASTER" -s $MASTER'/_all_dbs' | python -c "import sys, json; s= ' '.join(json.load(sys.stdin)).replace('_global_changes','').replace('_replicator','').replace('_users',''); print(s) ") for DB in $dbs; do V=$(cat <
http://docs.couchdb.org/en/latest/replication/index.html
Reply
Anonymous
Information Epoch 1740356283
Make every program a filter.
Home
Notebook
Contact us