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

Add hook for changing multiplicative suffix to dd operations to automati... #9

Closed kglueck closed 6 years ago

kglueck commented 9 years ago

...cally change based upon OS and make the change for Solaris

When zxfer is called with the -D option on Solaris (I'm using OmniOS a derivative of the OpenIndiana project), the zfs send/recv fail due to dd being called with errors like:

...
Estimated size is: 563945097936
dd: invalid number ‘1m’
dd: invalid number ‘1m’
   0.0B  at    0.0B/s   eta:   0:00:00    0% [=                                                                                              ]
Copied: 0B (0.0B ) (0% of expected input)
Time:  0 seconds
Throughput: (infinite)

cannot receive: failed to read from stream
Error when zfs send/receiving.

The suffix for the dd commands was hardcoded to '1m' when the -D option was added. This pull request adds the ability to automagically change this for Solaris to a '1M' but default to '1m' for other OSes.

allanjude commented 9 years ago

This might actually be required for some versions of linux as well.

A user might also wish to change the value. I'll consider adding a new param to allow the user to pass a value as well. I'll be back to you soon with either accepting your pull request, or committing a more generic solution

kglueck commented 9 years ago

It's possible someone would want to change the value as well, I guess... IMO, using a command-line option for something like that would be overkill, though. This very awesome tool already suffers from command-line option bloat...something I noticed while looking for available ones for adding a different feature I need to implement.

kglueck commented 9 years ago

...haven't heard anything from ya in a while...if you're not gonna merge in, that's fine...I can work in my own fork, but would be nice to know one way or another...

allanjude commented 9 years ago

Sorry for the delay, I just have not had time. I'll commit something this weekend that will solve this issue in a more flexible way

kglueck commented 6 years ago

Since the owner never decided to merge, I'll be closing my pull request to remove it from my dashboard.