How do I purge or remove old access log files to maintain free space on a Reporter server?

<< Back to Knowledge Search



The following command can be used on Windows Server 2003 and 2008 operating systems to delete access log files older than a given amount of days:


forfiles.exe /p C:\<log dir> /s /m *.* /d -180 /c "cmd /c del /q @path"


In the example above, all log files older than 180 days will be deleted.  You can alter the command argument after the "/d" option to any desired number of days.  Furthermore, substitute "<log dir>" for the actual directory where your logs are located.  To automate this process, create a text file containing the above command, then change its file extension to .CMD.  At this point the built-in Windows task scheduler can be used to run the command as often as desired.

NOTE:  forfiles.exe is a part of the Windows Resource kit.  If this file does not exist on your Windows 2003/2008 server, please install the Windows Resource Kit for your version of Windows.

Additional Information
Bug Number
InQuira Doc IdFAQ1324

Article Feedback

Hide Properties
First Published      10/01/2014
Last Modified      10/01/2014
Last Published      10/01/2014
Article Audience
Product      Reporter
Topic      Access Logging, Log Processing, Reporting, Upgrade / Maintenance
Article Number      000010607
Was this helpful?
Previous MonthNext Month