Skip to content

Instantly share code, notes, and snippets.

@spikegrobstein
Created November 16, 2012 23:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikegrobstein/4091940 to your computer and use it in GitHub Desktop.
Save spikegrobstein/4091940 to your computer and use it in GitHub Desktop.
Chef compaction script run via cron
#! /bin/bash -
curl -H "Content-Type: application/json" localhost:5984/chef
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact
sleep 3
for VIEW in nodes roles registrations clients data_bags data_bags_items users checksums cookbooks sandboxes environments id_map; do
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact/$VIEW
done
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_view_cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment