Skip to content

Instantly share code, notes, and snippets.

@cjerdonek
Created August 21, 2013 18:12
Show Gist options
  • Save cjerdonek/6297953 to your computer and use it in GitHub Desktop.
Save cjerdonek/6297953 to your computer and use it in GitHub Desktop.
A script to back up environments from chef server to your git repo.
# Back up environments from chef server to a git repo.
# Run this from the top of your chef repo.
envs=`knife environment list`
for env in $envs
do
path="environments/${env}.json"
knife environment show $env -F json > $path
git add $path
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment