Skip to content

Instantly share code, notes, and snippets.

@shtirlic
Created November 30, 2011 12:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shtirlic/1408924 to your computer and use it in GitHub Desktop.
Save shtirlic/1408924 to your computer and use it in GitHub Desktop.
Script for git repo backup in dropbox via git bundle
#!/usr/bin/env ruby
if __FILE__ == $0
bundle_name = ARGV[0] if (ARGV[0])
bundle_name = `pwd`.split('/').last.chomp if bundle_name.nil?
bundle_name += ".git.bundle"
puts "Backing up to bundle #{bundle_name}"
`git bundle create ~/Dropbox/backup/git-repos/#{bundle_name} --all`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment