builder/extra/tools/ruby-tpm/configure/modules/cluster_diagnostic_package.rb
def copy_log(src_path, dest_path, bytes)
    if File.exist?(src_path)
      fout = File.open(dest_path, 'w')

      File.open(src_path, "r") do |f|
        if bytes < File.size(src_path)
          f.seek(-bytes, IO::SEEK_END)
        end
        while (line = f.gets)
          fout.puts line
        end
      end

      fout.close
    end
  end
# Copy specified log's last n bytes.
Copy specified log's last n bytes.
Copy specified log ' s last n bytes .
def copy_log(src_path, dest_path, bytes)
    if File.exist?(src_path)
      fout = File.open(dest_path, 'w')
      File.open(src_path, "r") do |f|
        if bytes < File.size(src_path)
          f.seek(-bytes, IO::SEEK_END)
        end
        while (line = f.gets)
          fout.puts line
        end
      end
      fout.close
    end
  end
def copy_log ( src_path , dest_path , bytes ) if File . exist? ( src_path ) fout = File . open ( dest_path , 'w' ) File . open ( src_path , "r" ) do | f | if bytes < File . size ( src_path ) f . seek ( - bytes , IO :: SEEK_END ) end while ( line = f . gets ) fout . puts line end end fout . close end end
Copy specified log's last n bytes.
Copy specified log ' s last n bytes .
src_path
dest_path
bytes