Knowledgebase
How to cleanup scheduled task log files automatically?
Posted by Daniel Weuthen on 29 Nov 2012 11:30

The easiest way to clean up the log files is using the forfiles command which is included in the Windows 2003 Server Resource Kit. In recent versions of Microsoft Windows, the forfiles command is included as a standard feature.

To delete all task logs older than seven days, create a batch file (e.g. clean_mailstore_tasklog.bat) with the following content:

 forfiles /P "C:\Documents and Settings\All Users\Application Data\MailStore\TaskLog" '
 /S /M *.log /D -7 /C "cmd /c del @file : date >=7_Days"

Depending on the environment, the path to the task log directory has to be modified. Then, you can create a new scheduled task executing the new batch file clean_mailstore_tasklog.bat daily, for example.

(10 vote(s))
Helpful
Not helpful

Navigation
Remote Support

Please download this TeamViewer client in order to allow the MailStore support team a one-time only access to your system.

Got Premium Support?

If your MailStore Server license includes Premium Support or you are using the MailStore Service Provider Edition, you are entitled to get in touch with our support team directly via phone.

International

+49 2162-5029912

Phone (USA)

800-747-2915