Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: only take snapshots if files have been written #100

Open
DragonQ opened this issue Mar 22, 2023 · 8 comments
Open

Feature request: only take snapshots if files have been written #100

DragonQ opened this issue Mar 22, 2023 · 8 comments

Comments

@DragonQ
Copy link

DragonQ commented Mar 22, 2023

It'd be pretty cool to only have snapshots that actually are worth having. Seems fairly easy to implement based on this thread, e.g.

local WRITTEN=$(zfs get -H -o value written "${DATASET}")

if [ "${WRITTEN}" != "0" ]; then
  # take snapshot
fi
@yboetz
Copy link
Owner

yboetz commented Apr 2, 2023

Development on pyznap is pretty much on hold atm, I don't think I will have time to work on this in the near future. But I can keep it open if I ever get back to it.

@svennd
Copy link

svennd commented May 8, 2023

This looks like a nice feature, it seems easily to implement so I took a stab at it. I think it takes much more work to get it in a nice production ready state. But as a POC :

master...svennd:pyznap:master

I'm not a python person, just like this tool :)

@xylle
Copy link

xylle commented Jul 31, 2023

This is not necessary for ZFS, no files writing : 0 octet in snapshot

@svennd
Copy link

svennd commented Jul 31, 2023

I like this feature for the following use case : I keep allot of frequent and hourly snapshots. However I don't want my backup server to spin up every 15 minutes for no changes. Since half of the data I have is pretty much "stale" in terms of writting, this makes a lot of sense.

Also what is the point of having 100's of snapshots where 90% of them don't have any content even if the cost is near-zero.

@xylle
Copy link

xylle commented Jul 31, 2023

If there's no snapshot, is it because there was no need or because there was an error?
ZFS can handle a lot of snapshots, I've done them every 15 minutes for a year without any discomfort or slowdown.
But if it's a real need ...
For this type of content, why not change the frequency?

@svennd
Copy link

svennd commented Jul 31, 2023

Cause we never know when change might happen and then I don't want to be stuck with a 7 day old snapshot.

You are saying you have 35.060 snapshots (per pool) -only for frequent- snapshots alone ? I do like to be able to verify manually everything is running fine now and again. But everyones his own, this was only a feature request I liked personally.

Either way, I doubt yboetz will take up this or any other feature given the time constrains the developer has previously mentioned.

@xylle
Copy link

xylle commented Aug 1, 2023

So many snapshots is just for one pool, it doesn't make sense for the others, it's for files server in enterprise.
But as an option, it doesn't hurt.
It was just to give the information, ZFS is generally misunderstood.
For me, it's more "kiss" to do always the same things.

@yboetz
Copy link
Owner

yboetz commented Aug 1, 2023

I agree with xylle, I'd rather keep it simple than have too many options that complicate the code. Also, following the reddit thread I think the reasoning mercenary_sysadmin gave to not have it in sanoid also makes sense.

In any case, pyznap is not in active development at the moment since I don't have time to work on it :/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants