The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Vulcan::RRLogDir - Round Robin Log Directory

SYNOPSIS

use Vulcan::RRLogDir;

my $rrld = Vulcan::RRLogDir->new( @logdir );

$rrld->purge
( 
   count => 20, ## default 10
   regex => qr/^foobar/,
   size => '100MB',
   age => '10days',
);

METHODS

purge( %param )

Purge files according to %param. Returns invoking object.

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

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'