Skip to content

Instantly share code, notes, and snippets.

@toothrot
Forked from svladcjelli/TAILROBOCOPYLOGS.rb
Created May 22, 2009 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save toothrot/116213 to your computer and use it in GitHub Desktop.
Save toothrot/116213 to your computer and use it in GitHub Desktop.
locations = {
:name1 => "\\\\192.168.2.101\\e$\\gw.log",
:name2 => "\\\\192.168.2.101\\e$\\cima.log",
:name3 => "\\\\is-util02\\c$\\eba.log",
:name4 => "\\\\192.168.2.30\\c$\\DATA\\USERCOPYLOG.LOG",
:name5 => "\\\\192.168.2.30\\c$\\DATA\\PSTS.LOG",
:name6 => "\\\\192.168.2.105\\c$\\Program Files\\Windows Resource Kits\\Tools\\RC.log",
:name7 => "\\\\192.168.2.105\\c$\\Program Files\\Windows Resource Kits\\Tools\\RC2.log",
:name8 => "\\\\192.168.100.96\\f$\\QBROBOCOPY.LOG",
:name9 => "\\\\192.168.2.114\\c$\\RC2.LOG",
:name10 => "\\\\192.168.2.114\\c$\\RC.LOG" }
locations.each_pair do |client_name, location|
command = %Q[tail "#{location}"]
puts "======================================================================"
puts "x #{client_name}"
puts "x #{command}"
puts "======================================================================"
IO.popen(command) do |io|
io.each_line { |line| puts line }
end
end
%x[pause]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment