The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Vulcan::Cruft - Keep directories clean of cruft.

SYNOPSIS

 use Vulcan::Cruft;

 my $cruft = Vulcan::Cruft->new( @logdir );

 unlink $cruft->cruft
 ( 
    count => 20,
    regex => qr/^foobar/,
    size => '100MB',
    age => '10days',
 );
 

METHODS

cruft( %param )

Purge files according to %param. Returns a list of 'cruft'.

 regex: pattern of file name.
 count: number of files to keep.
 size: total file size.
 age: age of file.
 remove: remove cruft.

convert( $type, $expr )

Convert an $expr of $type to a number of base units. $type can be

time: base unit 1 second, units can be

 s[econd] m[inutea h[our] d[ay] w[eek]

size: base unit 1 byte, units can be B K M G T P E Z Y

An expression may consist of multiple units, e.g.

 '2h,3m,20s' or '2MB 10K'