KWSupport

Kevin Weilbacher [SBS MVP] blog on SBS, WHS and other topics of interest!

Recent Posts

Tags

News

  • Check out the "Song of the Week" link!
    Xobni outlook add-in for your inbox

Community

Email Notifications

SBS Blogs

SBS2003 Links

Archives

Cleanup log files

I stumbled across a handy Windows script file (WaRmZip) that is an all purpose utility for cleaning, compressing and/or moving outdated log files. For example, you may want to delete certain files older than X days. You can download this utility at WinAdmin's web site: http://winadmin.forret.com/scripts/warmzip

One use of this utility is to delete older IIS log files. Go to C:\Windows\System32\LogFiles directory on your server, and take a look at the contents of each of the subfolders (W3SVC1, etc).  You may be surprised to find hundreds of files in each of these subfolders. Using the WaRmZip utility, I can create a one line batch file to handle removing these log files, and then schedule this batch file to run weekly or monthly.

Here's the one line batch command: "C:\WaRmZip17\WaRmZip.wsf" "C:\Windows\System32\LogFiles" /da:7 /r /q

In this example, the da:7 option says to delete files older than 7 days, the /r option says to process all sub folders, and the /q option says to run it quietly (non verbose). There are options to zip/compress these files instead, if that is your preference, or to move them to a different drive/folder.

Enjoy!

Posted: Fri, Nov 24 2006 17:07 by kwsupport | with 3 comment(s)
Filed under: ,

Comments

Rob Waters - rwaters@petro-canada.ca said:

I thought this script would be just what we needed to clean up some Documentum user logon files (these multiply like rabbits) but when I ran the script with these parameters in both a command prompt and in a batch file 0-"C:\WaRmZip.wsf" /r "D:\Documentum\dba\log" /da:5 /df/dr/r/t

I received an error that there was an invalid procedure call or argument in line 470 char 8  Code 800A0005

Am I doing something wrong or is there a work around?

Thanks

# November 29, 2007 5:23 PM

KWSupport said:

Back in Nov-2006 I wrote about a free script (WaRmZip) you could download to be used for deleting old

# December 29, 2007 8:17 AM

KWSupport said:

Back in Nov-2006 I wrote about a free script (WaRmZip) you could download to be used for deleting old

# December 29, 2007 8:24 AM