Giter Club home page Giter Club logo

truenas-rename-snapshots's Introduction

truenas-rename-snapshots

Batch rename truenas snapshots.

-d        Filter by day of week 0 (Sunday) to 6 (Saturday)
-f        Run the script and do the actual renaming. By default, the script will execuate as a DRY_RUN
          without actually renaming any files. Set this flag to execute the script.
-l        List snapshots only
-m        Match snapshots using Regex. Uses grep. Be careful when using the script in a FreeBSD environment
          as grep in FreeBSD is missing a lot of important features for grep.
-r        Recursive look up. Include children datasets when querying snapshots. Usually, either -r or -R
          flags are set and not both.
-R        Recursive rename. Rename datasets recursively. Usually, either -r or -R flags are set and not both.

examples

Recursively rename snapshots from /tank/dataset1/child and its descendants

./rename -f -R -m "@auto" /tank/dataset1/child @auto @daily

---
previous snapshot name: /tank/dataset1/child/child@auto-2023-09-25_00-00
new snapshot name:      /tank/dataset1/child/child@daily-2023-09-25_00-00

Recursively retrieve snapshots from given dataset and rename them individually. This is much slower thatn the -r version.

./rename -f -r -m "@auto" /tank/dataset1/child @auto @monthly

---
previous snapshot name: /tank/dataset1/child/child@auto-2023-09-25_00-00
new snapshot name:      /tank/dataset1/child/child@monthly-2023-09-25_00-00

Rename snapshots that fall on a given day of the week. The following example finds snapshots that fell on a Tuesday.

./rename -f -d 2 -m "@auto" /tank/dataset1/child @auto @weekly

---
previous snapshot name: /tank/dataset1/child/child@auto-2023-12-17_00-00
new snapshot name:      /tank/dataset1/child/child@weekly-2023-12-17_00-00

List only snapshots with matching string.

./rename -l -m "@auto" /tank/dataset1/child

---
/tank/dataset1/child/child@auto-2023-12-10_00-00
/tank/dataset1/child/child@auto-2023-12-17_00-00
/tank/dataset1/child/child@auto-2023-12-24_00-00

truenas-rename-snapshots's People

Contributors

suppaduppax avatar

Watchers

 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.