Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Rules on deleting SharePoint Logs

  Asked By: Erin    Date: Oct 19    Category: Sharepoint    Views: 6277

Is there any "best practices" or "reasons" not to delete old SharePoint log
files from "Program Files\Common Files\Microsoft Shared\Web Server
Extensions\12\Logs" ?

Currently I'm running a scheduled task using the good 'ole "forfiles" command to
delete Sharepoint ULS logs older than 30 days.

1) What reprecussions could deleting old log files have.
2) What reprecussions could deleting the upgrade.log file have in the ULS log
file path?
3) What reprecussions could creating seperate directories for the trace logs and
the UsageAnalysis logs have?

Any links to online references regarding these questions also appreciated.

*note even though I have configured the diagnostic logging screen to hold a
specific number of files, I have hundreds more than the amount listed. The
server and farm has been fully rebooted but old files remain. I have overcome
this with the scheduled job below.

**********Scripts**************

This lists and keeps a record of files that are about to be deleted,(Be careful
- the Forfiles command deletes files out of the specified directory **AND ALL
SUBDIRECTORIES** !!)

forfiles /p "F:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\12\Logs" /s -m *.log /d -30 /c "cmd /c echo @path" >> "F:\Program
Files\Common Files\Microsoft Shared\Web Server
Extensions\12\DeletedLogs\DeletedLogRecord.txt"

This actually does the delete,(Be careful - the Forfiles command deletes files
out of the specified directory **AND ALL SUBDIRECTORIES** !!)

forfiles /p "E:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\12\Logs" /s -m *.log /d -30 /c "cmd /c del @FILE"

I found this a great scheduled task to remove old IIS Log files, just tweak the
location of where you store your IIS logs.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Rules on deleting SharePoint Logs Or get search suggestion and latest updates.




Tagged: