创建一个Shell脚本,该脚本将备份4周的数据。
这是针对将使用curl命令转储的benchDB服务器,这些天将在其4周的持续时间内转移到另一个ouchDB数据库。
# Creating a database enter code here
DB=DBNAME_$(date +"%Y"-)$(date +"%V")
echo "Creating ${DB}"
curl -X PUT ${SERVER}${DB}
# couchDB range for previous 4 week
# Insert/Create Design Documents
# JSON file is required along side with this script
echo "Creating Design Documents"
curl -X PUT http://${SERVER}${DB}/_design/LENAME -d @LENAME.json
echo "Creating Design Documents B"enter code here
curl -X PUT http://${SERVER}${DB}/_design/LENAMEB -d @LENAMEB.json'
该脚本每周运行一次,并将转储到新数据库中。