Ssh – rsync over ssh backup failing after relocation of server

freebsdrsyncssh

I've got two FreeBSD machines set up; one serves video data and the other is the backup for the first. At this point I've got around 4TB of data. I add files to the video server a few at a time, and was planning to use rsync over ssh to keep the backup machine up to date.

I did the initial, large backup with both machines hooked up to the same subnet at the lab with no problems using rsync. Then, when I moved the backup machine off-site (but still on the university network), I attempted a sync without changing anything other than the IP (as the machine is now on a different subnet) and got the following error:

2010/03/22 15:55:21 [1260] rsync: connection unexpectedly closed (6340840244 bytes received so far) [receiver]
2010/03/22 15:55:21 [1260] rsync error: error in rsync protocol data stream (code 12) at io.c(601) [receiver=3.0.7]
2010/03/22 15:55:21 [1258] rsync: connection unexpectedly closed (60 bytes received so far) [generator]
2010/03/22 15:55:21 [1258] rsync error: unexplained error (code 255) at io.c(601) [generator=3.0.7]

The script that handles the backup hasn't been changed, nor has the crontab that invokes it. Does anyone have any ideas about what might be causing the hiccup? I was under the impression that it might have something to do with the ssh connection timing out or something along those lines, but am not entirely clear on how to diagnose the cause of the problem.

Best Answer

It appears like your connection has been established and data has been transmitted so it doesn't seem like the issue is related to your known_hosts or establishing your connection.

If there was a NAT between the 2 computers and rsync needed to calculate the checksum for a large file then it seems like it would be possible that the time it takes to calculate the checksum would exceed the length of time that the translation for your connection is saved in the state table. I would be tempted to add an option like this ServerAliveInterval 60 on the machine acting as the ssh client to force keep alives to be sent.

Related Topic