dirsize is intended to keep a directory under a specified size by removing the oldest files in the directory. Typical usage would be pointing at a directory of log files or nightly backups. By using this script, you can ensure that you are keeping as much data as possible while still not exceeding your disk capacity.

Project

Requirements:

  • Perl

To check out the source code:

svn co https://wush.net/svn/foss/dirsize/

To browse the source online,  click here.

To submit a bug report,  click here.

To view existing bug reports,  click here.

Documentation

Usage: dirsize /path/to/clean size_in_mb

dirsize will remove the oldest files from the specified path until the total size is under size_in_mb.