NAME

File::Rotate::Simple - no-frills file rotation

SYNOPSIS

use File::Rotate::Simple;

File::Rotate::Simple->rotate(
    file => '/foo/bar/backup.tar.gz',
    age  => 7,
    max  => 30,
);

File::Rotate::Simple->rotate(
    files => [ qw{ /var/log/foo.log /var/log/bar.log } ],
    max   => 7,
);

DESCRIPTION

This module implements simple file rotation.

Files are renamed to have a numeric suffix, e.g. backup.tar.gz is renamed to backup.tar.gz.1. Existing file numbers are incremented.

If "max" is specified, then any files with a larger numeric suffix are deleted.

If "age" is specified, then any files older than that number of days are deleted.

Note that files with the extension 0 are ignored.

AUTHOR

Robert Rothenberg, <rrwo at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2015 Robert Rothenberg.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0