Created
February 16, 2016 00:24
-
-
Save bkrodgers/9c33349ec04dbe3c4263 to your computer and use it in GitHub Desktop.
Export data from etcd into a runnable script
This file contains 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
for path in $(etcdctl ls -p --recursive) ; do | |
case "$path" in | |
*/) | |
echo "etcdctl setdir '$path'" >> etcd-dump.sh | |
;; | |
*) | |
val=$(etcdctl get $path) | |
echo "etcdctl set '$path' '$val'" >> etcd-dump.sh | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment