Skip to content

Instantly share code, notes, and snippets.

@bkrodgers
Created February 16, 2016 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkrodgers/9c33349ec04dbe3c4263 to your computer and use it in GitHub Desktop.
Save bkrodgers/9c33349ec04dbe3c4263 to your computer and use it in GitHub Desktop.
Export data from etcd into a runnable script
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