1

I have two machines in different site. Two machine have FreeBSD and ZFS volume. One is master. and other one is backup.

I usually do a backup by this command that invoked by cron.

zfs send -i pool/vol@old pool/vol@new | ssh backup zfs recv pool/vol

But the snapshot is quite large. It needs over 24 hours, and sometime it lost the connection. If that was happen I need to re-send it first byte.

Is there any way to reconnect the ssh connection without brake pipe?

For example, I can imagine the command chunked_send and chunked_recv.

zfs send -i pool/vol@old pool/vol@new | chunked_send id1 ssh backup chunked_recv id1 zfs recv pool/vol

update:

One naive solution is use temporary file and rsync.

zfs send -i vol@old vol@new | split -b 1024m backup-tmp.
rsync backup-tmp.* backup:/tmp
ssh backup 'cat /tmp/backup-tmp.* | zfs recv vol'

I feel this is not smart.

2
  • Maybe you want to use rsync for this? Feb 1, 2014 at 5:10
  • Did you mean use rsync at first or use rsync to send the chunk? Using rsync for backup is one option, but it needs to scan all file lists instead of modified file only. Using rsync to send chunk, it requires temporary disk writing.
    – user295103
    Feb 1, 2014 at 5:28

1 Answer 1

0

Try encapsulating the TCP connection in UDP packets. The simplest way to do this is to install a OpenVPN udp network between the two servers.

UDP connection can wistand occasionnal disconnects. SSH connections over UDP VPN does not appear to disconnect. I'm not sure about your command, but i'm fairly certain it would resist disconnections if used over a OpenVPN network.

I've written a OpenVPN installation guide for Debian that may help you. It provide a tool easing OpenVPN server setup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .