On 2008-06-04, Mallikarjun Melagiri <[EMAIL PROTECTED]> wrote:
> Hi Noah,
>
> I am new to python. I'm trying to use pexpect.
>
> Following is my problem definition:
>
> I should have a script on my machine A, which
> should 'ssh' to machine B and from there i
Hi Noah,
I am new to python. I'm trying to use pexpect.
Following is my problem definition:
I should have a script on my machine A, which
should 'ssh' to machine B and from there it shud copy a file to machine
C thru 'scp'.
Please help me.
Regards
M
>
>
>
>
> cmd ='scp'+' '+source_file+' '+user+'@'+ip+':'+desti_path
>
You might wanna try to login with a public/private key pair, then scp
won't ask for a password.
--
http://mail.python.org/mailman/listinfo/python-list
import sys,os
import pexpect
source_file= 'sourcefile.txt'
user='username'
ip='00.00.00.00'
desti_path='/home/jai/………'
password='bond007'
cmd ='scp'+' '+source_file+' '+user+'@'+ip+':'+desti_path
try:
foo = pexpect.spawn(cmd)
foo.expect('.ssword:*'
Kevin Erickson wrote:
> On Jun 30, 5:50 pm, Kevin Erickson <[EMAIL PROTECTED]> wrote:
> > #Begin Code
> >
> > import sys
> > import pexpect
> >
> > def GetServerData(self):
> > foo = pexpect.spawn('scp [EMAIL PROTECTED]:/home/config/
> > role{/file1,/files/file2,/files/file3} /tmp')
>
On Jun 30, 5:50 pm, Kevin Erickson <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am attempting to use pexpect in python to copy files from a server
> using scp; the copy works however exceptions are thrown and it exits
> unsuccessfully. Below is the a sample code and the error:
>
> #Begin Code
>
> im
Hello,
I am attempting to use pexpect in python to copy files from a server
using scp; the copy works however exceptions are thrown and it exits
unsuccessfully. Below is the a sample code and the error:
#Begin Code
import sys
import pexpect
def GetServerData(self):
foo = pexpect.sp