how to write a script to know problem in network(rsync is going on)
Hi All
I am having a problem like i scheduled a script that do the rsync of data(~5GB)from one server to another on WAN on weekly basis. Now the issue is it takes 4 days, 5days and some time to 1 week to complete(Probably due to network issue). I have written a script that check the exit status of rsync and send me the mail accordingly. exit status is zero:-> mail"rsync is done" exit status is non-zero:-> mail"rsync is not done" But i did a test i broke the network during rsync is going on and my script get hanged and after that error like network problem and i did not get any mail for that. So now my question is how to figure out problem in network during rsync through script so i could know rsync is not successfully done due to network problem or if there is any other solution... Thanks in advance. |
Obviously it takes time. 5GB is not a little data. And also it depends up on your servers configurations. Can you tell server configurations and the script you have run?
|
Are both machines on the same switch/router?
Is there a firewall between them? Have you verified that both network interfaces are set to 100Mb/s Full-Duplex? Are you able to view the logs of the switch/router to see if there are errors on the ports that the two machines are plugged in to? All of those were troubleshooting steps that I took within the past couple of weeks to determine why one of my servers had a dramatically slower throughput speed when doing it's nightly backups to tape. It turned out, that the switch port was seeing massive numbers of errors that we finally linked back to a mismatch of NIC settings. Both NICs were set to autonegotiate with the switch, but one was getting 100Mb/s Full and one was getting 100Mb/s half and sometimes even 10Mb/s half. After I forced the NICs to 100Mb/s Full, my throughput increased from 157kb/s to over 800kb/s, and now backups that were taking close to 8 hours take less than 1 hour. |
Adding "--progress" to your rsync command can provide very helpful information, such as transfer speed of files and a summary of total data transferred + speed at the end of the process.
|
Hi All
Thanks for the response. Right now i am not having access of remote server so some troubleshooting steps i cant do. And --progress is already added to rync. So at this point of time i want that if there is any issue in network during rsync going on, i should get a mail. But whats happening due to network issue, script get hanged and i am not getting any mail. Any suggestion... |
All times are GMT -5. The time now is 05:43 PM. |