Skip to content

Instantly share code, notes, and snippets.

@mikitebeka
Created June 5, 2010 23:08
Show Gist options
  • Select an option

  • Save mikitebeka/427086 to your computer and use it in GitHub Desktop.

Select an option

Save mikitebeka/427086 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -ne 1 ]; then
echo "usage: $(basename $0) DB"
exit 1
fi
case $1 in
-h | --help ) echo "usage: $(basename $0) DB"; exit;;
esac
db=$1
tmp=$(mktemp)
trap "rm -f $tmp" SIGINT SIGTERM
cat <<EOF > $tmp
{
"source": "$db",
"target": "http://db2.saucelabs.com:5984/$db",
"continuous": true
}
EOF
curl -X POST http://localhost:5984/_replicate -d@$tmp
rm -f $tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment