No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-11-17 16:51:52 +00:00
bin Add latest symlink and no_latest init option 2022-01-29 15:43:25 +00:00
dist Add explicit Provides to spec 2022-11-17 16:51:52 +00:00
lib/File Add latest symlink and no_latest init option 2022-01-29 15:43:25 +00:00
File_PruneDir.3.md Add latest symlink and no_latest init option 2022-01-29 15:43:25 +00:00
LICENSE Initial Commit as module/cli 2021-12-28 18:12:33 +00:00
Makefile.PL Tweak Makefile.PL for correctness 2021-12-29 15:47:20 +00:00
prunedir.1.md Add latest symlink and no_latest init option 2022-01-29 15:43:25 +00:00
README.md Cleanup module and project documentation 2021-12-29 15:44:18 +00:00

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