This tool clears up unneeded log files in SBS 2008. For more information check this FAQ
a Wayne Small website
This tool clears up unneeded log files in SBS 2008. For more information check this FAQ
This site uses Akismet to reduce spam. Learn how your comment data is processed.
looking at the script one of the lines says del c:\windows\system32\certlof\*.jrs which I believe should read del c:\windows\system32\certlog\*.jrs instead. I would suggest the file be updated. Awesome job otherwise. Thanks!
thanks Greg – fixed it now! Appreciate your feedback.
To preserve 30 days of logs for troubleshooting, substitute the following. Don’t know how wordwrap will affect this so I’ve put a blank line between each command that looks like it might wrap.
rem Certificate Services Logs
net stop “Active Directory Certificate Services”
forfiles /d -30 /p “%windir%\system32\certlog” /m *.log /c “cmd /c del @file”
forfiles /d -30 /p “%windir%\system32\certlog” /m *.chk /c “cmd /c del @file”
forfiles /d -30 /p “%windir%\system32\certlog” /m *.jrs /c “cmd /c del @file”
net start “Active Directory Certificate Services”
rem IIS Log Files
forfiles /d -30 /p C:\inetpub\logs\LogFiles /m *.log /s /c “cmd /c del @file”
I still have something else that’s slowly consuming many GBs of SBS disk space. Have had IIS logs under control for years, but didn’t know about CertLog, from which I recovered 2GB. Every little bit helps! Thanks, and will continue my search for the other culprit(s).
Looks like nothing wrapped, but curly quotes were substituted for straight quotes, so make sure to change them back. Reposting with the Code XHTML I didn’t notice before to see if that helps.
rem Certificate Services Logs
net stop "Active Directory Certificate Services"
forfiles /d -30 /p "%windir%\system32\certlog" /m *.log /c "cmd /c del @file"
forfiles /d -30 /p "%windir%\system32\certlog" /m *.chk /c "cmd /c del @file"
forfiles /d -30 /p "%windir%\system32\certlog" /m *.jrs /c "cmd /c del @file"
net start "Active Directory Certificate Services"
rem IIS Log Files
forfiles /d -30 /p "C:\inetpub\logs\LogFiles" /m *.log /s /c "cmd /c del @file"
Is this script OK to use on any other SBS or Windows Server platforms?
So is the .cmd link at the top of the page the latest and greatest? Or the 4/21 post?
They lead to the same file 🙂
lead to the same file?
at the top of the page is a link to the cmd and that uses
del c:\windows\system32\certlog\*.jrs
but the april 21st post has a script in it and uses:
forfiles /d -30 /p “%windir%\system32\certlog” /m *.jrs /c “cmd /c del @file”
forfiles has to be copied to the server, right? It’s not a native app?
My apologies Mike – the link @ top of the page is the file I’ve created and use. The comment that JRV posted on April 21st has not been integrated into the file I’ve created as I’ve not tested it.
I didn’t read your initial comment correctly. 🙁
Can this be used to cleanup sbs2011 and windows server 2008r2?