Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #for kris from kris :)
- if [ $# -lt 1 ]
- then
- echo "Useage: $0 <github username> <number of pages>"
- exit
- fi
- dir="githubBackup"
- user="$1"
- let pages="$2"
- mkdir -p "$dir/$user"
- cd "$dir/$user"
- clear
- echo "Backing up all github projects for $user..."
- for p in `seq 1 $pages`;
- do
- wget -q "https://github.com/metalx1000?page=$p&tab=repositories" -O- |\
- grep codeRepository|\
- cut -d\" -f2|\
- while read url
- do
- #git clone "https://github.com${url}.git"
- repo="$(echo "$url"|cut -d\/ -f3)"
- wget "https://github.com${url}/archive/master.zip" -O "${repo}_master.zip"
- done
- done
- clear
- echo "${user}'s projects backed up to $(pwd)."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement