From LedHed's Wiki
Revision as of 00:32, 13 August 2016 by Ledhed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

This command line utility will delete files from a specified path when the directory exceeds a specified maximum size. It is useful for ensuring archived log files don't fill up a hard drive. It is intended to be run as a scheduled task.

Disclaimer of Warranty

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

Limitation of Liability

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Use at your own risk!


Features

  • Filename filter (*.log)
  • Test Mode (see what files will be deleted before deleting them)
  • Recursive (can traverse sub directories)


Download

LogRotate.zip


Usage

LogRotate.exe /l D:\Logs /M 8GB /r /f *.evtx

The above command will delete the oldest .evtx files in D:\Logs reducing the total size of D:\Logs (including logs in sub directories) to less than 8GB.


Notes

You will need .NET 4.5 in order to run this application.


ChangeLog

V1.0.0.1 (8/12/2016)

  • Bug/Feature: Previous version would only delete a single file. LogRotate will now delete multiple files until the directory size is below the MaxSize value.


V1.0.0.0 (8/8/2016)

  • Initial realease