NAME

Maplat::Worker::DirCleaner - Clean stale files from directories

SYNOPSIS

This module cleans out old/stale files from configured directories

DESCRIPTION

This module provides a simple directory cleaner for multiple directories. Currently, no recursive cleaning is done (we're working on that, stay tuned). Just configure the module, the actual cleaning is done automatically.

Configuration

<module>
        <modname>dircleaner</modname>
        <pm>DirCleaner</pm>
        <options>
                <reporting>reporting</reporting>
                <memcache>memcache</memcache>
                <db>maindb</db>
                <limit>1000</limit>
                <directory>
                        <path>/full/path/to/dir</path>
                        <maxage>8</maxage>
                </directory>
                ...
                <directory>
                        <path>relative/path/to/dir</path>
                        <maxage>7</maxage>
                </directory>
        </options>
</module>

maxage is the maximum age in days the files are allowed to reside in the directory

limit denotes the limit of how many files to clean out in a single run. This option prevents the module of monopolizing harddisk IO.

work

Internal function.

clean

Internal function.

Dependencies

This module depends on the following modules beeing configured (the 'as "somename"' means the key name in this modules configuration):

Maplat::Worker::PostgresDB as "db" Maplat::Worker::Memcache as "memcache" Maplat::Worker::Reporting as "reporting"

SEE ALSO

Maplat::Worker

AUTHOR

Rene Schickbauer, <rene.schickbauer@magnapowertrain.com>

COPYRIGHT AND LICENSE

Copyright (C) 2009 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.