#!/usr/bin/env ruby # # (C) Henri Shustak 2008 # Lucid Information Systems # http://www.lucidsystems.org # Licenced Under then GNU GPL # # This very basic tool may be used to merge multiple loadsets together # Version 1.0 ( Very Basic - Just Provides You A List Of Files To Paste Onto the Command Line) # If you develop this script then please submit a patch so that eveyone may benifit. # At this stage it is very basic. However, it could be easily imporved so that it will # offer more functionality. # # Aim : # This script provides you with a list of transcripts which can then be merged together. # Effectivly, if you have a list of transcripts such as : # my_updates_v001.T # my_udpates_v002.T # my_updates_vXXX.t # This script will allow you list all the paths to these transcrtips and reverse the order # # Usage : # Edit the lines which have comments above them telling you to edit them # Then run the script and you will have a list of load sets which you can merge together # I wrote this script before I knew about the 'tac' command which is not installed by default # on Mac OS X. # # Finally you can use lmerge to merge this list together into one transcript. #./lmerge -n [-vIV] [ -D path ] [ -u umask ] transcript1 transcript2 dest require 'fileutils' # You should edit the line below for your requiremnts transcripts_dir = Dir["/var/radmind/transcript/common_names_of_transcripts_to_be_mreged*.T"] transcripts_dir = transcripts_dir.reverse # Weed out the onese we do not want in the new transcript array new_transcripts=[] x = 0 transcripts_dir.each do |f| # You should edit the line below for your requirments if (( f.strip != "/var/radmind/transcript/name_of_transcript_to_remove.T" ) && ( f.strip != "/var/radmind/transcript/name_of_transcript_to_remove.T" )) new_transcripts[x] = f x = x + 1 end end input_transcripts = "" new_transcripts.each do |f| input_transcripts = input_transcripts + " " + f end puts input_transcripts