
Permit use of Git while still supporting Subversion. Improve the script structure and reduce dependence on hard-coded paths.
33 lines
887 B
Ruby
Executable file
33 lines
887 B
Ruby
Executable file
#! /usr/bin/ruby
|
|
|
|
=begin
|
|
--------------------------------------------------------------------------------
|
|
|
|
Copy the Tomcat logs into a time-stamped directory in the current "version"
|
|
directory, for possible inspection later.
|
|
|
|
--------------------------------------------------------------------------------
|
|
--------------------------------------------------------------------------------
|
|
=end
|
|
|
|
require File.expand_path('subscripts/common', File.dirname(__FILE__))
|
|
require 'date'
|
|
|
|
def figure_time_stamp()
|
|
return DateTime.now.strftime("%Y-%m-%d_%H-%M-%S")
|
|
end
|
|
|
|
@tomcat_logs_dir = version_file('tomcatLogs')
|
|
if (! File.directory?(@tomcat_logs_dir))
|
|
Dir.mkdir(@tomcat_logs_dir)
|
|
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|
|
|
system("cp #{@home}/tomcat/logs/* .")
|
|
end
|
|
|