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

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

book

Article ID: 166158

calendar_today

Updated On:

Products

Reporter Reporter-VA Reporter-S500

Issue/Introduction

Reporter database has stopped processing new access log and is reporting "out of disk space".  The issue might be related to known issue on the reporter that does not delete files as expected. Another issue is with duplicate logs.  When reporter cannot read access log file (file is broken, upload was terminated) it generate duplicate file. 

You need manually remove logs from reporter. 

Resolution

A. Manually delete files through one of the following options:

  • FTP Client (such as Filezilla)
    • Connect to Report with a user that has adequate permissions and delete files per FTP client's instructions.
  • CLI
    • Use the enable "access-logs delete <file path>/<file name>" to remove file.
    • A "*" wildcard can be used to mass delete files.  
    • Use the wildcard along with filename to delete files based on file name.  You can only use first part of a file name followed by wild card.
    • Example file name will delete all files that start with SG_main__2610: SG_main__2610*

B. On Windows Server 2003 and 2008 operating systems the following command can be used 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.