Skip to content

Instantly share code, notes, and snippets.

@gorsuch
Last active December 29, 2015 18:59
Show Gist options
  • Save gorsuch/7714279 to your computer and use it in GitHub Desktop.
Save gorsuch/7714279 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# execute like: ruby clone_loop.rb | tee clone_loop.log
require 'fileutils'
REPO = '[email protected]:gorsuch/nothing'
DEST_DIR = 'nothing'
loop do
FileUtils.rm_rf(DEST_DIR)
start = Time.now
output = `git clone #{REPO} #{DEST_DIR} 2>&1`
finish = Time.now - start
exitstatus = $?.exitstatus
puts "t=#{finish} exitstatus=#{exitstatus}"
puts output unless exitstatus.zero?
sleep 1
end
@gorsuch
Copy link
Author

gorsuch commented Nov 30, 2013

Usage: ruby clone_loop.rb | tee clone_loop.log

I'm running this in a tmux session so I can view the data in the foreground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment