-
Notifications
You must be signed in to change notification settings - Fork 36
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
Allow not take snapshots recursively #6
Comments
Hm I specially made pyznap with recursive snapshots in mind. I think I would have to do some restructuring to allow for non-recursive snapshots. I'll have to think about this. |
Hi, I'm thinking that we need this more and more. A use case below; Then the config could look like this, snapshotting everything under storage except storage/zroot. [zroot] [storage] [storage/zroot] |
Yes, that will not be possible, as you would take additional snapshots in
A bit more configuration, but now will work as intended. The thing is, I specifically made pyznap with recursive snapshots in mind, as I wanted atomic snapshots across all children of a dataset. For that I have to use recursive snapshots. If I were to allow non-recursive snapshots, then this would not be the case anymore and I would have to go through each child dataset and take a snapshot if the policy says so. So this is a design choice that I'd like to keep like this. I would have to think if this is possible in any other way, maybe taking snapshots then immediately deleting the ones that shouldn't be recursive... If you want to have snapshots in all child datasets except for ones then you could just specify it in your config like this
Now But this does not work for zfs send destinations, as you want to keep snapshots there and not take new ones. So for that you would have to do it like I described above. Edit: Note that for the second example to work, you need to explicitly set all values to 0 in the retention policy to overwrite the parent settings. Options not set will be overwritten by parent values. |
I see, do you think you could maybe add an extra config option; eg "recursive = yes", this will take snapshots with -r. On the other hand when "recursive=no" is set, it loops through underlying datasets. Just a thought as how you could possibly tackle this. |
Yes that might be a possibility. I'll have to see how hard that is to implement and how much time I have :). |
Thanks for considering |
Note that the following command actually works atomically (only within the same pool), so if the command can be built in the script (and it's not too long) it works. zfs snapshot rpool/dataset1@snapshot rpool/dataset2/snapshot [-r] |
Hm that is quite interesting, thanks. At the moment there is a 'ZFSDataset' class that has a 'snapshot' function that takes a snapshot of that dataset only (optionally with -r specified). So I would have to rewrite that a bit s.t. multiple snapshots across the same pool can be taken in one command. |
pyznap with recursive snapshot as an option can be the best backup solution. I use proxmox and other systems with zfs. Znapzend - I have several servers but due to ZFS params maintenance is horrible and has not snap / send separation |
I have not had time yet, it's still on my to do list for pyznap... For now you can use the workaround described above. If you only want to take snapshots of child filesystems, you can also set up a policy similar to mine:
Here you specify the policy at the root (rpool) level, but set |
A few things… with zfs channel programs you can make atomic snapshots of everything and they don't have to be recursive |
As @redmop said, you can take atomic snapshots within the same pool by specifying
But this would need some restructuring of the python code, as at the moment every dataset is a class instance and calls its own |
We have stuff in a pool that we want to snap, but not snap a child dataset which is a zfs send destination.
|
Here is a pull request adding the config option to run non-recursive snapshots. I basically list on the config each dataset target with the non-recursive option so that I can choose each sub-tree to snapshot differently. |
It takes snapshots for all childs but I'm using docker in my server and take that snapshots involve taking snapshots for all docker driver stuff.
This doesn't make sense for me when I only want to backup my zroot volume.
It could be fix with a new config option like
recursively = no
.Thanks for your software!
The text was updated successfully, but these errors were encountered: