How to detect hanging rsync from bash-script ?

Karl O. Pinc kop at meme.com
Mon Apr 10 13:48:43 UTC 2017


On Mon, 10 Apr 2017 06:50:24 +0000 (UTC)
reiner otto via rsync <rsync at lists.samba.org> wrote:

> I am using rsync on an unreliable mobile WAN connection, which causes
> rsync receiver to hang for long time, when connection is broken
> during transfere. As the option "--timeout=" here does not hit for
> me, is there a recommended "best" method to detect such scenario ?

One good way would be to use rsync's --rsh option to
invoke ssh yourself with something like -o ServerAliveInterval.

It's not clear to me how you'd get the ssh error code back
out of rsync, in other words what error rsync returns in the
case of transport failure.  Maybe 10?  Perhaps someone else
can chime in here?


Karl <kop at meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein



More information about the rsync mailing list