allanjude / zxfer

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

Progress indicator corrupts stream #38

Open corny opened 6 years ago

corny commented 6 years ago

In some cases the progress bar breaks the transfer. I am running FreeBSD 11.1.

One attempt:

$ zxfer -dkFv -O root@remotehost -D 'bar -s %%size%%' -R zroot zroot/backups/remotehost
Sending zroot/var@second to zroot/backups/remotehost/zroot/var.
  (incremental to zroot/var@first.)
Estimated size is: 244950208
100% [====================================================================]
cannot receive incremental stream: checksum mismatch or incomplete stream
Error when zfs send/receiving.

Another attempt:

$ zxfer -dkFv -O root@remotehost -D 'bar -s %%size%% -bl 1m -bs 256m' -R zroot zroot/backups/remotehost
Sending zroot/var@second to zroot/backups/remotehost/zroot/var.                     
  (incremental to zroot/var@first.)
Estimated size is: 244950208
Error: -s cannot be specified for multiple input files.
cannot receive: failed to read from stream
Error when zfs send/receiving.
corny commented 5 years ago

I did some development on zfs-snapback to support this feature in a stable way.

allanjude commented 5 years ago

I am not sure what you are seeing, but it doesn't cause this issue for me. Which command is outputting the 'Error: -s cannot be specified for multiple input files', as that is not from ZFS

moisseev commented 5 years ago

Error: -s cannot be specified for multiple input files. is from bar. It seems bar has problems with command line parsing. BTW, There are no -bl and -bs options in bar's documentation, just -b.

allanjude commented 5 years ago

Error: -s cannot be specified for multiple input files. is from bar. It seems bar has problems with command line parsing. BTW, There are no -bl and -bs options in bar's documentation, just -b.

You might be using a different utility also called bar. The sysutils/clpbar on freebsd does have -bs (buffer size) and -bl (block size).

$ bar --version bar version 1.11.1

moisseev commented 5 years ago

Indeed I was using textproc/bar as well as OP, I guess. Thank you, I wouldn't find sysutils/clpbar by myself. I think zxfer's man should be more specific about that.