allanjude / zxfer

A continuation of development on zxfer, a popular script for managing ZFS snapshot replication
BSD 2-Clause "Simplified" License
124 stars 40 forks source link

adding mbuffer optional functionality - feasibility check #44

Closed petr-fischer closed 6 years ago

petr-fischer commented 6 years ago

Hello! Is possible to add mbuffer optional functionality (I can do it and send push request). Look, this is typical zxfer call:

$LZFS send -i "$copyprev" "$copysrc" | $RZFS receive $option_F "$copydest";

So we can add this to every send/receive call:

$LZFS send -i "$copyprev" "$copysrc" | $SOMETHING | $RZFS receive $option_F "$copydest";

It can be optional: if we want mbuffer, we set SOMETHING to mbuffer and if we don't want mbuffer, we can set SOMETHING simply to cat.

Do you have any comments on it? Is that feasible? Shall I try it? Thanks!

allanjude commented 6 years ago

You shouldn't need to modify zxfer to do this, I added this feature already:

-D 'mbuffer ...settings...'

It also replaces %%size%% in the command with the estimated size of the send stream, so you can get a progress bar from whatever tool you use (clpbar, pv, dpv, mbuffer, etc)

allanjude commented 6 years ago

You can find it in the code as zfs send | $PROGRESS_DIALOG | zfs recv

petr-fischer commented 6 years ago

I see it! Thanks.