can cygwin rsync handle temporary network outages?
We're using Deltacopy's distribution of Cygwin Rsync (v3.0.4, I believe) to backup two large Virtualbox virtual hard drives from our work Windows 7 VM host, over the internet through Logmein Hamachi VPN, to an XP PC in my boss's basement. I have rsync running in a batch file which monitors the return error code rsync gives, and restarts the rsync command if the error code isn't 0. It works just fine. Mostly...
Occasionally the connection goes down for a few seconds up to a few minutes (I've troubleshooted the loss of the connection to my boss's home ISP disconnecting; the work internet connection is fine). Rsync will throw an error 12, then continue throwing error 10's every time the batch file tries to restart the backup, until the connection re-establishes itself, usually within three minutes, sometimes right away. I have been looking for a way to get the rsync process to not fail but wait patiently for the connection to come back. Here's my command: rsync.exe -v -rlt -z -h --chmod=a=rw,Da+x --delete --progress "/cygdrive/E/VMbackups/Server2003.vdi" "ham.achi.ip.address::BU1/VMbackups/Server2003.vdi" I found the "--timeout" switch which sets a timeout limit on I/O, but defaults to no timeout if not used. (I think...) There's also "--contimeout", which sets a limit on how long rsync will wait to establish a connection. (Does this apply for waiting for a connection to re-establish?) Is there anything to make rsync wait a while for a previously active but presently dropped connection to reconnect before throwing an error? |
Hmm. I read this http://www.unix.com/unix-dummies-que...k-outages.html on the unix.com forum today.
I think --timeout might be what you are looking for. |
Yep, same question different forum :)
The man page for rsync says this about --timeout: --timeout=TIMEOUT This option allows you to set a maximum I/O timeout in seconds. If no data is transferred for the specified time then rsync will exit. The default is 0, which means no timeout. I had interpreted this to mean that "no timeout" = no limit imposed, ie, wait forever. I just tried looking at this from the "other side" of my head and realize this may mean, no tolerance for timeouts? Am I now seeing this right? I'll try putting the switch in. Thanks for the quick response, SZ! |
Well, I'm afraid it didn't fly. I added "--timeout=600", which should, if I had read right, have allowed for a 10-minute window before showing an error. Here's the updated command:
rsync.exe -v -rlt -z -h --chmod=a=rw,Da+x --timeout=600 --delete --progress "/cygdrive/E/VMbackups/Server2003data.vdi" "ham.achi.ip.address::BU1/VMbackups/Server2003data.vdi" I let it go for a while to be sure data was being transferred, then I remoted into the basement PC and disconnected the VPN client. Regrettably, the rsync process on the local PC errored out and quit within 5 seconds. I also tried "--contimeout=600" too, same result. Any thoughts? |
Is there a better forum for this question?
|
Any other thoughts?
Anyone have other ideas on how to get an rsync to wait for a network connection that dropped out to return?
We've tried --timeout and --contimeout without success... |
All times are GMT -5. The time now is 10:34 AM. |