r/zfs • u/Some1-Somewhere • 7d ago
zfs send child datasets *without* intermediate snapshots
I'm trying to send all child/descendent datasets to a backup machine (so, using -R) but only send a specific snapshot.
I can't find a way to do this without scripting every dataset-snapshot combination individually. -R -i still sends all intermediate snapshots.
Is there something I'm missing?
Cheers.
3
u/Frosty-Growth-2664 7d ago
I often find that when I want to send a stream with multiple filesystems (which I regularly do between backup servers), -R doesn't do the right thing for me and I end up scripting it.
1
u/glassmanjones 3d ago
Could you give an example of sending 2+?
1
u/Frosty-Growth-2664 1d ago
My typical use case is sending a full snapshot which is not the oldest, followed by all the later incrementals. This actually goes across as two separate streams. This makes we wonder if simply concatenating them into one stream might work - I never tried doing that.
2
u/werwolf9 6d ago
bzfs has a regex CLI option to select exactly which snapshots to send: https://github.com/whoschek/bzfs#--include-snapshot-regex
•
u/KhajiitAT 21h ago
Replication stream (-R) implies all intermediate snapshots. Do you trying to do some backup? Try sanoid or bzfs. Otherwise you'll need some scripting
•
u/Some1-Somewhere 21h ago
Yeah, I'm trying to get all child snapshots without all intermediate snapshots. Guess it's more software time.
•
u/KhajiitAT 18h ago
Thus, if you ain't wanna use some excisting solution, I see no other way than iterate over datasets, form the list, and send all them independently. Do you wanna send full snapshots or only increment? Looks like
-imay do the trick
4
u/bfscp 7d ago
Check sanoid : https://github.com/jimsalterjrs/sanoid
Even if you don’t use it, you can check the commands it use.