Giter VIP home page Giter VIP logo

zfs-prune-snapshots's Introduction

ZFS Prune Snapshots

Remove snapshots from one or more zpools that match given criteria

Examples

Remove snapshots older than a week across all zpools

zfs-prune-snapshots 1w

Same as above, but with increased verbosity and without actually deleting any snapshots (dry-run)

zfs-prune-snapshots -vn 1w

Remove snapshots older than 3 weeks on tank1 and tank2/backup. Note that this script will recurse through all of tank1 and all datasets below tank2/backup

zfs-prune-snapshots 3w tank1 tank2/backup

Remove snapshots older than a month on the zones pool that start with the string "autosnap_"

zfs-prune-snapshots -p 'autosnap_' 1M zones

Timespec

The first argument denotes how old a snapshot must be for it to be considered for deletion - possible specifiers are

  • s seconds
  • m minutes
  • h hours
  • d days
  • w weeks
  • M months
  • y years

Usage

usage: zfs-prune-snapshots [-hnv] [-p <prefix] <time> [[dataset1] ...]

remove snapshots from one or more zpools that match given criteria

examples
    # zfs-prune-snapshots 1w
    remove snapshots older than a week across all zpools

    # zfs-prune-snapshots -vn 1w
    same as above, but with increased verbosity and without
    actually deleting any snapshots (dry-run)

    # zfs-prune-snapshots 3w tank1 tank2/backup
    remove snapshots older than 3 weeks on tank1 and tank2/backup.
    note that this script will recurse through *all* of tank1 and
    *all* datasets below tank2/backup

    # zfs-prune-snapshots -p 'autosnap_' 1M zones
    remove snapshots older than a month on the zones pool that start
    with the string "autosnap_"

timespec
    the first argument denotes how old a snapshot must be for it to
    be considered for deletion - possible specifiers are

        s seconds
        m minutes
        h hours
        d days
        w weeks
        M months
        y years

options
    -h             print this message and exit
    -n             dry-run, don't actually delete snapshots
    -p <prefix>    snapshot prefix string to match
    -v             increase verbosity

License

MIT License

zfs-prune-snapshots's People

Contributors

bahamas10 avatar

Watchers

 avatar  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.