swaroop has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am trying to get the files using scp.
***************************************************
************************************************$timeout = 5; $scp_command = "$SCP -v -r remoteuser@remote_host:/tmp/test /tmp/"; $Scp = Expect->spawn($scp_command); $Scp->log_stdout(0); $Scp->exp_internal(1); while ( $Scp->expect(2,"Are you sure you want to continue connecting ( +yes/no)?") ) { print $Scp "yes\n"; } sleep(60); $Scp->expect(1,"password:"); print $Scp "$password\n"; $Scp->soft_close(); $Scp->hard_close();
The problem is some times i am getting less files , some times no files. What could be the problem ? How can I wait till the files transfered ?
Please help.20050413 Janitored by Corion: Added code tags, more formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expect problem
by naChoZ (Curate) on Apr 12, 2005 at 23:07 UTC | |
by ikegami (Patriarch) on Apr 12, 2005 at 23:18 UTC | |
|
Re: Expect problem
by jbrugger (Parson) on Apr 13, 2005 at 04:58 UTC | |
by swaroop (Beadle) on Apr 13, 2005 at 21:03 UTC | |
by swaroop (Beadle) on Apr 13, 2005 at 22:20 UTC |