Code Monkey home page Code Monkey logo

zfs-prune-snapshots's Issues

Feature request - dry-run

It'd be great if we had an option to run dry-run or something else that would show an amount of space taken by zfs snapshots.

Syntax error with space in pool name.

./zfs-prune-snapshots: line 145: Shows@data_1534448870 1534448871: syntax error: invalid arithmetic operator (error token is "@data_1534448870 1534448871")

I know it's old and I shouldn't have a space, but any chance you could help fix it? I looked thru the code, but I'm not super good with bash.

Clonejails can cause data loss

Hi, I'm still wrapping my head around what happened.

The core issue that zfs destroy can delete a whole dataset.
In my case, it deleted the release snapshots of my jails, with the recursive options. Jails are by default created as clonejails, so effectively it deleted the /root of my jails.

I'm not sure if there is anything that could be done by the script, but maybe a disclaimer could be sufficient on the README?

I was able to save 4 out of 7 jails because those four were busy and the snapshots couldn't be deleted.

Add install procedure

Currently, there is no way to know how to install your code. Is it possible to add a "how to install" section in the readme ? It would be even better to have GitHub releases used (well, and in the best of the worlds a PPA for ubuntu noobs like me 😅, but I do understand if ou don't find that mandatory)

Dealing with snapshots that have dependent clones

Hi,
Love the project, extremely useful.

When cleaning up, I am getting alot of snapshot has dependent clones use '-R' to destroy the following datasets:

Would be really helpful if there was a safe was to deal with this in batch.

Enhancement - check permissions during dry run

A nifty improvement might be if the dry run option also confirmed whether you had the permissions to actually do the deletion.

e.g. you can do a dry run without sufficient rights and it's a bit misleading.

I do note that the 'native' zfs destroy has the same issue, so perhaps this is either everyone's preferred behaviour, or it's difficult to implement.

Feature Request - Counter

It would be nice to have a running counter of how many snapshots are left to remove.

Something like:
removing 81 of 9512 tank/dataset@autosnap_date

Thanks.

How to get it working in cron

I've tried using the correct path /usr/local/bin/zfs-prune-snapshots 1M but then I get the message Error! zfs command not found. Are you on the right machine?

Any clue as to what I'm doing wrong?

Error executing the script

Hi team,

I'm trying to use this script, i do not have any coding experience.
my SunOS version is 11.4. when i'm running the script i got below error

./zfs-prune-snapshots.sh -vn 2M

./zfs-prune-snapshots.sh: line 161: %s: syntax error: operand expected (error token is "%s")

Please help to suggest what went wrong.
Thanks
Rohit

Thanks!

Tried it and it helped, thank you !

time for a release?

What do you think, is it time for a first release of this?

I would like to include this script in Alpine Linux and it would help if its tagged.

Dry Run Output shows wrong units

If I ask to prune a number of days, it correctly picks the snapshots to remove, but labels them all '1 week old' rather than 'X days old'

»»»» date
Wed 22 May 2024 10:03:24 AM EDT
»»»» zfs-prune-snapshots -n -R 10d
found 28 snapshots (165 GB) on pools: <all>
[dry-run] [1/28] removing tank/backup@autosnap_2024-05-09_18:02:17_daily: 1 week old (56 KB)
[dry-run] [2/28] removing tank/backup@autosnap_2024-05-10_00:00:20_daily: 1 week old (0 B)
[dry-run] [3/28] removing tank/backup@autosnap_2024-05-11_00:00:17_daily: 1 week old (0 B)
[dry-run] [4/28] removing tank/backup@autosnap_2024-05-12_00:00:27_daily: 1 week old (56 KB)
#snipped...

[Feature request] Protect last `x` number of snapshots

When using syncoid, or other send-based backup solution, the last snapshot is used to calculate the delta to send an incremental stream. Using your script in that application would run the risk of destroying snapshots that zfs send/recv needs for incremental backup. It'd be nice if there was a feature to protect the last x number of snapshosts as to ensure their existence regardless of time cut-off point.

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.