Giter VIP home page Giter VIP logo

archive_rotate's Introduction

archive_rotate

This script rotates archived files by user specified pattern.

Usage:

./archive_rotate.sh [-c -r -v --dry-run] -p=Path [-s=searchpattern] [-h=…|-d=…|-w=…|-m=…|-y=…]

Example:

./archive_rotate.sh -crv -p="/volume1/home/MySQL_Backup/" --searchpattern="WordPress_*" --filesperhour="*x48" -d=24x7 -m="1x*"

  • The specification for the number of files and time periods is separated by an "x" [DIGITxDIGIT eg. -h=7x6 for 7 files per hour for 6 hours].
  • The time periods are added together. This means that the next larger period starts at the end of the previous smaller period.
  • Older files outside the defined period are deleted if parameters -c / --cleanig are set, otherwise the files are ignored.
  • Periods and counts can also be defined as wildcards [*].
  • LIMITATION: Intervals are dynamic! For example, if 12 files are to be kept per year, and all files of this period are from one day, 12 files will also be kept, although they have a disproportionately small time interval.

-p= --path= Path to parent directory

Arguments for the count of kept files and count of the respective period:

    -h= --filesperhour=     how many files per how many hours [eg. 60x24 means: 24 hours with 60 files each]
    -d= --filesperday=      how many files per how many days
    -w= --filesperweek=     how many files per how many weeks
    -m= --filespermonth=    how many files per how many month
    -y= --filesperyear=     how many files per how many years 

optional arguments:

    -r  --recursive         also searches in subdirectories
    -v  --verbose           explain what is being done
    -c  --cleaning          delete files out of range
        --dry-run           perform a trial run with no changes made
    -h  --help              display help and exit

archive_rotate's People

Watchers

Stephan Geisler avatar

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.