how to write a script to know problem in network(rsync is going on)
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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...
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?
Distribution: Red Hat Enterprise Linux, Fedora, CentOS
Posts: 134
Rep:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.