Windows Logfile Archival Script

(Moran, Craig M (BAH)) #1

There’s a zlib extension to Ruby? I am unfamiliar with it.


-----Original Message-----
From: Kent S. []
Sent: Friday, February 13, 2004 2:05 PM
Subject: Re: Windows Logfile Archival Script

By the way, there is a zlib extension which you can use instead of
relying on WinZip installed on your computer.


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,
I wanted to share a handy code snippet. This comes in very handy on
boxes for archiving log files. This will require that WinZip as well as
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.

#/usr/bin/env ruby
require ‘ftools’

files = Dir["*.log"]
files.each {|file| system(""/Program Files/WinZip/WZZIP.EXE" -m
"C:\Logfiles\" " +""" + file + “”")}