I have a script run by cron that rsync's various folders to a server in a different city to publish files to websites. In case it matters, the source server is within the corporate firewall and the destination server is outside.
The script uses a locking system to prevent multiple instances of itself running at the same time.
rsync is occasionally (up to 1-3 times per day) failing with the error:
rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at io.c(604) [sender=2.6.9]
I found some advice suggesting that I specify a timeout value, so I added the flag --timeout=10 to the command. The result was a different error:
io timeout after 10 seconds -- exiting rsync error: timeout in data send/receive (code 30) at io.c(165) [sender=2.6.9]
The receiving server likely has quite a heavy load, so that may be a factor.
Does anyone have any suggestions for avoiding these errors?