Custom Search

Oct 30, 2011

Are w3svc1 log files getting very large, taking up too much of your Windows Server hard drive space?

Microsoft Windows Server 2003 is a pain to maintain. It doesn't automatically clean any log files, and recently I had to automate the clean up for another set of log files that grew to 100+ GB in size.

I have the disk space monitored using an in-house script, I put together. Soon you'll be able to get it at: http://radicmonitor.blogspot.com/

I received an email letting me know that the server is running low on hard drive space. After reviewing the graphs, I noticed that in the past 5 days, the free space went from 40GB down to 90MB. This is a problem.

To locate the problem I used an awesome tool I have used for several issues before: JDiskReport

To quickly resolve the problem, I followed the advice in this thread: http://social.technet.microsoft.com/Forums/en/configmgrgeneral/thread/d989b249-0159-41fc-b78c-1f1d91ce8bb3







Basically, you have do the clean up yourself. Just schedule an automatic cleanup every Sunday:

Just invoke the task scheduler using the following command:


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



12/04/2011: COMING SOON - A script to customize the above command for your environment. Add yourself to my email update list above.


Adjust the paths and the schedule to fit your needs.


NOW you have to go back to your event logs and see what's causing the logs to blow up. 

Let me know if this helped you in the comments section below.


6 comments:

  1. Thanks! This is what I needed. question though, how do I setup this task? i tired to copy and past into the actions but it wont work.

    ReplyDelete
  2. Ah no, nevermind, I was using the GUI and not command line...thanks again!

    ReplyDelete
  3. You actually copy and paste the command and run it in a command line window. The command itself will create the task.

    In Windows 2000/XP:

    Go to "Start" -> "Run" -> "cmd"

    In Windows Vista/7:

    Go to "Start" -> "cmd"

    ReplyDelete
  4. Where do I see those jobs? Also would like to be able to delete thme

    ReplyDelete
  5. :) Just found it. http://www.dba-oracle.com/t_windows_job_schedulers_examples.htm

    ReplyDelete
  6. Ok...

    This may sound really weird, maybe even a little "out there..."

    BUT what if you could just press "PLAY" and LISTEN to a short, "miracle tone"...

    And magically bring MORE MONEY to your LIFE??

    And I'm talking about BIG MONEY, even MILLIONS of DOLLARS!

    Think it's too EASY?? Think this couldn't possibly be for REAL?!?

    Well then, Let me tell you the news.

    Many times the greatest miracles in life are also the SIMPLEST!

    In fact, I will PROVE it to you by allowing you to listen to a real-life "miracle money tone" I've synthesized...

    You just click "PLAY" and watch how money starts piling up around you.. starting pretty much right away..

    CLICK here to experience the marvelous "Miracle Money Tone" - as my gift to you!

    ReplyDelete