Created
December 1, 2011 18:01
-
-
Save benjaminws/1418607 to your computer and use it in GitHub Desktop.
save databags to disk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get all your data bags, save them to disk | |
set -e | |
KNIFE=/usr/bin/knife | |
SAVE_DIR=~/chef-repo/data_bags | |
for bag in `$KNIFE data bag list`; do | |
for item in `$KNIFE data bag show $bag`; do | |
/bin/mkdir -p $SAVE_DIR/$bag/ && | |
$KNIFE data bag show -f json $bag $item > $SAVE_DIR/$bag/$item.json; | |
done; | |
done; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment