2011-12-14 22:01:35 +00:00
|
|
|
#! /usr/bin/ruby
|
|
|
|
|
|
|
|
=begin
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Copy the Tomcat logs into a time-stamped directory in the current "version"
|
|
|
|
directory, for possible inspection later.
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
=end
|
|
|
|
|
2013-10-21 15:21:54 -04:00
|
|
|
require File.expand_path('subscripts/common', File.dirname(__FILE__))
|
2011-12-14 22:01:35 +00:00
|
|
|
require 'date'
|
|
|
|
|
|
|
|
def figure_time_stamp()
|
|
|
|
return DateTime.now.strftime("%Y-%m-%d_%H-%M-%S")
|
|
|
|
end
|
|
|
|
|
2013-10-21 15:21:54 -04:00
|
|
|
@tomcat_logs_dir = version_file('tomcatLogs')
|
|
|
|
if (! File.directory?(@tomcat_logs_dir))
|
|
|
|
Dir.mkdir(@tomcat_logs_dir)
|
2011-12-14 22:01:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Dir.chdir(@tomcat_logs_dir) do |path|
|
|
|
|
@this_logs_dir = "#{path}/#{figure_time_stamp()}"
|
|
|
|
Dir.mkdir(@this_logs_dir)
|
|
|
|
end
|
|
|
|
|
|
|
|
Dir.chdir(@this_logs_dir) do |path|
|
2013-10-21 15:21:54 -04:00
|
|
|
system("cp #{@home}/tomcat/logs/* .")
|
2011-12-14 22:01:35 +00:00
|
|
|
end
|
|
|
|
|