Last active
December 29, 2015 18:59
-
-
Save gorsuch/7714279 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.