Dir::Purge

Dir::Purge is a Perl module to purge directories to a given number of files.
Download

Dir::Purge Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Johan Vromans
  • Publisher web site:
  • http://search.cpan.org/~jv/mmds-1.902/MMDS/Properties.pm

Dir::Purge Tags


Dir::Purge Description

Dir::Purge is a Perl module to purge directories to a given number of files. Dir::Purge is a Perl module to purge directories to a given number of files.SYNOPSIS perl -MDir::Purge -e 'purgedir (5, @ARGV)' /spare/backups use Dir::Purge; purgedir ({keep => 5, strategy => "by_age", verbose => 1}, "/spare/backups"); use Dir::Purge qw(purgedir_by_age); purgedir_by_age (5, "/spare/backups");Dir::Purge implements functions to reduce the number of files in a directory according to a strategy. It currently provides one strategy: removal of files by age.By default, the module exports one user subroutine: purgedir.The first argument of purgedir should either be an integer, indicating the number of files to keep in each of the directories, or a reference to a hash with options. In either case, a value for the number of files to keep is mandatory.The other arguments are the names of the directories that must be purged. Note that this process is not recursive. Also, hidden files (name starts with a .) and non-plain files (e.g., directories, symbolic links) are not taken into account.All directory arguments and options are checked before anything else is done. In particular, all arguments should point to existing directories and the program must have read, write, and search (execute) access to the directories.One additional function, purgedir_by_age, can be exported on demand, or called by its fully qualified name. purgedir_by_age calls purgedir with the "by age" purge strategy preselected. Since this happens to be the default strategy for purgedir, calling purgedir_by_age is roughly equivalent to calling purgedir. Requirements: · Perl


Dir::Purge Related Software