Created
October 25, 2013 19:36
-
-
Save vioan/7160581 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
# | |
# https://github.com/jooray/github-backup | |
# | |
require "yaml" | |
require "open-uri" | |
require "shellwords" | |
# your github username | |
username = "USERNAME" | |
backupDirectory = Shellwords.escape("PATH_TO_BACKUPS") | |
YAML.load(open("https://api.github.com/users/#{username}/repos")).map{|repository| | |
puts "Discovered repository: #{repository['name']}" | |
system "git clone #{Shellwords.escape(repository['clone_url'])} #{backupDirectory}/#{Shellwords.escape(repository['name'])}" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment