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

Failure when using openzfs port on remote server #53

Open hxw opened 3 years ago

hxw commented 3 years ago
allanjude commented 3 years ago

It is actually not hard coded:

LZFS=$( which zfs )
RZFS=$LZFS

Just make sure your PATH prefers /usr/local/sbin before /sbin and it should "do the right thing"

hxw commented 3 years ago

For the local side:

% command -v zfs
/sbin/zfs

For remote side:

freenas:~ # command -v zfs
/usr/local/sbin/zfs

/sbin/zfs is hard coded for -O and -T options:

https://github.com/allanjude/zxfer/blob/1cc89cc681e1351a9b4e8750d9e078b66485910b/zxfer#L1943 https://github.com/allanjude/zxfer/blob/1cc89cc681e1351a9b4e8750d9e078b66485910b/zxfer#L1962

I am using -T so I think the second line is the problem. I expect a separate ssh command -v zfs is necessary to get the remote path.

hxw commented 3 years ago

It just occurred to me that the PATH will be setup on the remote so ssh $OPTARG zfs should always work, so no need to hard code the /sbin path in the ssh commands.