LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-22-2008, 07:20 AM   #1
abhishekrahel
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Rep: Reputation: 0
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.
 
Old 10-22-2008, 07:35 AM   #2
bkcreddy17
Member
 
Registered: Feb 2008
Location: India-Hyderabad
Distribution: RHEL and Fedora
Posts: 171

Rep: Reputation: 15
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?
 
Old 10-22-2008, 08:45 AM   #3
Linville79
Member
 
Registered: Nov 2006
Location: Indiana, U.S.A.
Distribution: Red Hat Enterprise Linux, Fedora, CentOS
Posts: 134

Rep: Reputation: 16
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.
 
Old 10-22-2008, 02:07 PM   #4
strick1226
Member
 
Registered: Feb 2005
Distribution: Arch, CentOS, Fedora, macOS, SLES, Ubuntu
Posts: 327

Rep: Reputation: 63
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.
 
Old 10-24-2008, 12:37 AM   #5
abhishekrahel
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Original Poster
Rep: Reputation: 0
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync script for the first patches of Slackware 11 Alien Bob Slackware 4 10-26-2006 01:06 PM
local rsync shell script eradrix Programming 13 07-09-2005 12:57 AM
rsync script twantrd Programming 2 01-06-2005 05:46 AM
Red Hat 9 server can't write PHP script, problem in httpd.conf file? x_menno_x Linux - Newbie 27 06-29-2004 04:44 PM
bash script HELP - dnotify > rsync GuitsBoy Programming 5 01-28-2004 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration