Giter VIP home page Giter VIP logo

fileprune's Introduction

Build Status Coverity Scan Build Status

Fileprune will delete files from the specified set targetting a given distribution of the files within time as well as size, number, and age constraints. Its main purpose is to keep a set of daily-created backup files in managable size, while still providing reasonable access to older versions. Specifying a size, file number, or age constraint will simply remove files starting from the oldest, until the constraint is met. The distribution specification (exponential, Gaussian (normal), or Fibonacci) provides finer control of the files to delete, allowing the retention of recent copies and the increasingly agressive pruning of the older files. The retention schedule specifies the age intervals for which files will be retained. As an example, an exponential retention schedule for 10 files with a base of 2 will be

1 2 4 8 16 32 64 128 256 512 1024

The above schedule specifies that for the interval of 65 to 128 days there should be (at least) one retained file (unless constraints and options override this setting). Retention schedules are always calculated and evaluated in integer days. By default fileprune will keep the oldest file within each day interval allowing files to migrate from one interval to the next as time goes by. It may also keep additional files, if the complete file set satisfies the specified constraint. The algorithm used for prunning does not assume that the files are uniformally distributed; fileprune will successfully prune file collections stored at irregular intervals.

Project home

You can download the source and executables from the project's page. You can also read more in the article Organized pruning of file sets. ;login:, 28(3):39-42, June 2003.

Building

  • To build the program under Unix, Linux, Cygwin run make
  • To build the program under Microsoft C/C++ run nmake /f Makefile.mak

fileprune's People

Contributors

dspinellis avatar nomeata avatar

Stargazers

Alastair Irvine avatar Scott Ivey avatar Joshua Briefman avatar Florin Popa avatar  avatar Raphael Michel avatar Pantelis Koukousoulas avatar Panayotis Vryonis avatar

Watchers

 avatar James Cloos avatar  avatar  avatar  avatar

fileprune's Issues

Too much pruning with irregular backups

The setting fileprune -e 1.25 works well for my backups which I do daily. But a backup that is only done occasional, I find the results surprising:

        2015-03-23.20h58
        2015-05-01.09h41
        2015-08-09.16h04
        2015-09-28.22h51
        2015-11-29.19h16
        2016-01-02.18h59
        2016-02-10.23h26
        2016-02-28.11h58
        2016-03-17.11h51
        2016-04-07.19h16
        2016-05-14.20h59
        2016-05-24.13h25
2016-05-31.19h39
2016-06-06.12h37
2016-06-28.10h29

The first column lists backups retained, while the second backups deleted. Why does it delete all those backups?

Pruning until enough disk space free

It would be nice if I could tell fileprune to keep deleting file until n bytes are free on the file system – this seems to be the most natural choice for backups on a dedicated disk. This would also go well with pruning directories (issue #1) even without having a reliable way of calculating the spaces used by a directory.

Never deleted youngest file

Hi,

in certain circumstances, fileprune seems to be happy to delete the youngest backup. This is most likely not what you want, e.g. if there is a symbolic link pointing to the "latest" which is used as a source for rsync --link-dest. Maybe that should be special-cased?

(I’m still using my own fork which can handle directories and stuff, so if this does not apply to the mainline, sorry.)

Greetings,
Joachim

Getting age from filename

I might not trust my file system meta data always and might not want to risk fileprune to delete all my backjust just because I accidentally ran touch *. As often the directories are named by $(date -R) or something similar, it would be nice if fileprune would take a strptime pattern and apply that to the file name to get the file’s age.

Pruning directories

(JFTR, this ways already reported by mail).

It would be nice if fileprune was able to prune whole directories. This would probably not go well with with the size constraint (-s), but otherwise it should work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.