From: Alan J. <al...@ra...> - 2003-07-18 18:39:00
|
Thanks for the prompt reply. As you have suggested, I have included the script below. Maybe that can give you a clue as to what is going wrong. Thanks for the help. ----------------------------------------------------------------------------- #!/usr/bin/perl use Expect; #change the source and destination path here! $ssh=Expect->spawn("rsync -avzu --delete --progress --stats --rsync-path /path-to-rsync -e ssh /source-path account\@xxx.edu:/destination-path"); # No changes needed from here on $ssh->expect(10,"ssword: ") || die "Never got password prompt on rci.rutgers.edu, ".$ssh->exp_error()."\n"; # We got the prompt, so send a password. print $ssh "xxxxxxx"; $match=$ssh->expect(10,"closed by foreign host","-re",'[%>$]\s'); die "Files have been updated on xxx.edu\n" unless $match; $ssh->hard_close(); -------------------------------------------------------------------------- On Tue, 15 Jul 2003 db...@ct... wrote: > > I tried reproducing the slowness problem you mentioned since one of my > boxes is Redhat 9 but was unable. > > I tried the following: > > 1.) scripting lengthy "ls -la" in a telnet session to remote machine. > 2.) scripting rsync <username>@<hostname>:<remotefile> <localfile> for > JPG file about 160K in size. > > When installing modules, I got the same "default pty only handles 155 > bytes" message, also another message saying that raw pty was ok, and > handled 512+ bytes. This was when running "make test" on the Expect > module. Setting both $exp->raw_pty(1) and $exp->raw_pty(0) on different > trial runs before spawning either process didn't seem to make a difference. > Both processes took just a second or so each. > > I'm trying to think of what could be causing your problem. If you're using > Expect to spawn rsync, it's the rsync process that's moving the data; not > expect. expect is just it's parent and thus getting STDOUT from the rsync > process, so I'm thinking the amount of data rsync is moving between the > websites in itself should be irrelevant. Are you running the most current > versions of everything? If you can post some of the relevant code I'll > take a look when I get a minute > > > > > > > > Alan Jiang <al...@ra...> > Sent by: To: expect <ex...@ih...> > exp...@li...urc cc: exp...@li... > eforge.net Subject: Re: [Expectperl-discuss] help!! > > > 07/14/03 08:03 PM > > > > > > > I am quite sure it is a expect problem because if I run the rsync process > independent of expect (i.e. manually entering the password at the prompt > insteading of having expect module to automate the procedure), everything > runs just fine. One more piece of evidence is that I didn't get this > warning message about default pty can only handle 155 bytes when I > installed it on redhat 7.2, and the module works perfect on that system. I > wonder if rehhat 9.0 is doing something funny that messes up the expect > module. > > Alan > > > On Mon, 14 > Jul 2003, expect wrote: > > > On Mon, 14 Jul 2003 13:14:42 -0400 (EDT) > > Alan Jiang <al...@ra...> wrote: > > > > > Hi, > > > I have an emergency problem that I need your help. I have just > installed > > > expect-1.15 on redhat 9.0 and receive the following warning message: > > > > > > Warning: your default pty can only handle 155 bytes at a time! > > > ok 30 > > > > > > This warning message didn't come up during the installation on > !!!redhat > > > 7.1!!!! > > > I use your expect module to work with rsync to synchronize two website. > > > > It now takes forever to update (serveral runs for just one small file). > > > > Can you please tell me how this problem can be solved? Thanks. > > > > > > Alan > > > > You probably need to convince me that it's an Expect problem. > > You haven't so far. > > > > Maybe you can wrap some timings around things using > > use Benchmark; > > > > to make your case. > > |