Skip to content

Instantly share code, notes, and snippets.

@scarytom
Last active December 16, 2015 17:29
Show Gist options
  • Save scarytom/5470587 to your computer and use it in GitHub Desktop.
Save scarytom/5470587 to your computer and use it in GitHub Desktop.
github backup script development
#!/bin/bash
set -e
set -u
API_URL="https://api.github.com"
TMP_DIR="/tmp/gh-bak"
curl -s "$API_URL/orgs/netmelody/repos" | grep '"full_name":' | sed -rn 's/.*: \"(.*?)\".*/\1/p' > $TMP_DIR/repos.lst
curl -s "$API_URL/users/scarytom/repos" | grep '"full_name":' | sed -rn 's/.*: \"(.*?)\".*/\1/p' >> $TMP_DIR/repos.lst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment