Script to compress log files to .zip archive

I found a VB script that compresses the log files into windows cabinet files, however the format that we need these files to be is .zip to support our WebTrends server - does anyone know of a script that will compress these IIS log files into a .zip archive?

LVL 1
jpipitoneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kim RyanIT ConsultantCommented:
You can use a Winzip utility from the MS-DOS command line  to create .zip file. This could be wrapped in a DOS batch file.
http://www.winzip.com/prodpagecl.htm
0
jpipitoneAuthor Commented:
well we need to grab the log file locations from our IIS configuration, then delete the log files after they are compressed, as this script does:

http://www.iisfaq.com/Default.aspx?tabid=2809

I need .zips created rather than .cab as this script does everything I need it to do with the exception of the archive format.
0
Kim RyanIT ConsultantCommented:
You can still use the script you referred to above.  I do not have the time do give you a complete solution, but it should be fairly simple. In brief,  the lines below will need to modified it to invoke winzip rather than makecab.

Command = "makecab " & chr(34) & Filespec & chr(34) & " " & chr(34) & CabFileSpec & chr(34)
 ReturnCode = WshShell.Run(Command, 7, True)

----
And and few lines above, u probably want the file to be end with .zip instead of .cab

CabFilename = left(NewFilename, len(NewFilename)-3) + "cab"
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

jpipitoneAuthor Commented:
OK - when you get time would you be able to tell me how to invoke winzip rather than makecab?
0
Kim RyanIT ConsultantCommented:
First you need to check if you have Winzip Pro as only this version has command line support. You can download an evaluation copyu but may have to buy a licence at some stage. I don't have the product with me at the moment, actual name would be in the documentation. But say for example, the utulityi is called winzip

CabFilename = left(NewFilename, len(NewFilename)-3) + "cab"  
changes to
CabFilename = left(NewFilename, len(NewFilename)-3) + "zip"

Command = "makecab " & chr(34) & Filespec & chr(34) & " " & chr(34) & CabFileSpec & chr(34)
changes to
Command = "winzip " & chr(34) & Filespec & chr(34) & " " & chr(34) & CabFileSpec & chr(34)

That is the basic logic, but can't be sure of all the details without being able to run the code myself. Hope this helps.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jpipitoneAuthor Commented:
Cool I'll try it out and see what I can come up with - I appreciate the help.
0
Kim RyanIT ConsultantCommented:
Glad to help, hope this solution works for you.
0
jpipitoneAuthor Commented:
I've installed WinZip and the command line add on and it throws this error:

ArchiveOldWebSiteLogfiles.vbs(100,4) Microsoft VBScript runtime error: Type mismatch: 'cint'

Any ideas?
0
Kim RyanIT ConsultantCommented:
Only guessing but perhaps this means an error at line 100 of the script? You may want to try manually compressing a log first to see the configuration is OK.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.