Wednesday, June 09, 2010

W3SVC Log Files are Filling Up Your SBS's System Drive

I can't believe that I haven't encountered this sooner:  The system drive on an SBS 2003 was full.  I used my trusty SequoiaView and found that the W3SVC1 folder was 6.14GB - OUCH!  A quick Google search yielded an excellent discussion of how to deal with the matter.


At a command prompt enter this all on one line:


at 12:00 /EVERY:Su Forfiles.exe -p C:\WINDOWS\system32\LogFiles\W3SVC1 -m *.log -d -30 -c "Cmd.exe /C del @path\" 


This will schedule a job that will run every Sunday and remove W3SVC1 log files that are >30 days old.


Thanks to Tom Watson for posting this gem!

4 comments:

Anonymous said...

Can this be applied to any type of file? This command could be very useful.

Thanks-

Anonymous said...

nice.

Anonymous said...

Brilliant. TY.

jamesfo8376 said...

You must take part in a contest for probably the greatest blogs on the web. I will advocate this website! gsn casino