Skip to navigation
Bash script to backup all couchdb databases to a json giz files
25.07.15
#!/bin/bash TIMESTAMP=$(date +"%F") BACKUP_DIR="//mnt/bak/couchdb/$TIMESTAMP" COUCHDB=user:pass@127.0.0.1:5984 mkdir -p "$BACKUP_DIR" dbs=`curl -X GET http://$COUCHDB/_all_dbs | grep -Po '[A-Za-z0-9_.]*'` for db in $dbs; do curl -X GET http://$COUCHDB/$db/_all_docs\?include_docs\=true | gzip > "$BACKUP_DIR/$db.json.gz" done
http://couchdb.apache.org/
Reply
Anonymous
Information Epoch 1732582575
Effectiveness beats efficiency.
Home
Notebook
Contact us