- Perl 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| bin | ||
| dist | ||
| lib/File | ||
| File_PruneDir.3.md | ||
| LICENSE | ||
| Makefile.PL | ||
| prunedir.1.md | ||
| README.md | ||
File::PruneDir and prunedir
This project contains the perl module File::PruneDir and a command line wrapper prunedir
The module is designed to maintain and prune a directory tree containing daily time-stamped directories of the form YYYYmmdd It uses a configuration file in the main directory to hold details of how many daily weekly and monthly directories should be kept.
A typical use within a backup script for an application like PostgreSQL might be as follows
MASTERDIR=/var/backup/myapp BACKUPDIR=`prunedir --new --dir "$MASTERDIR" ` pg_dump --dbname myapp --file="$BACKUPDIR/myapp.db.sql" bzip2 "$BACKUPDIR/myapp.db.sql" prunedir --prune --dir "$MASTERDIR"
In this context prunedir will create a new subdirectory of the format YYYYMMDD. The directory will be given the same access permissions as the master directory. After the output file is compressed prunedir is called again to prune the older subdirectories according to the rules in the configuration file in the master directory.
Refer to either the command utility documentation prunedir or the module documentation for embedded use File::PruneDir