From: Tom Copeland Date: 2004-02-14T04:13:17+09:00 Subject: Re: Windows Logfile Archival Script On Fri, 2004-02-13 at 13:15, Moran, Craig M (BAH) wrote: > I have been doing a lot of automation scripts with Ruby. Since I'm new to > the list, I'm not entirely sure this is the forum for this contribution, but > I wanted to share a handy code snippet. This comes in very handy on Windows > boxes for archiving log files. This will require that WinZip as well as its > command line utilities are installed. Apologies in advance if this isn't > the place to share code. Just let me know. If this code can be done more > elegantly or concisely, please share. > Craig > > #/usr/bin/env ruby > require 'ftools' > > Dir.chdir("C:/Logfiles") > files = Dir["*.log"] > files.each {|file| system("\"/Program Files/WinZip/WZZIP.EXE\" -m > \"C:\\Logfiles\\Archived.zip\" " +"\"" + file + "\"")} Hi Craig - That's cool; you could also put it here: http://rubyforge.org/snippet/browse.php?by=cat&cat=1 Yours, tom