Question : URGENT: copy files from one node to another node using pyxmlrpcClient

Hi Experts,
I want a small program which should function like basic scp command using python. But it should not use system scp command. It should use python rpc and should copy files.


BR Dushan.

Answer : URGENT: copy files from one node to another node using pyxmlrpcClient

Thnks for the clarification

a few suggestions


Porbably not what you like but already better than os.system()
1.) use subprocess.Popen
==========================
- stay with sshd on the server side ( targethost)
- use subprocess.popen and redirect stdin, stdout, stderr as pipe to your script.

advantage should work rather quickly
disadvantage yu had to port it later

2.) use PExpect
=============
same as 1.) but instead of subprocess.popen you can use PExpect.
gives you a little more control and handles even applicationsm, that expect a real terminal.

disadvantage.
still not portable.
PExpectt works only under cygwin if IIRC.
WIndows had to use WExpect

3.) use an ssh capable python library and build scp on top of it
===================================================
http://www.lag.net/pipermail/paramiko/2005-April/000069.html
For example paramiko
paramiko requires also the module Crypto:
http://www.voidspace.org.uk/python/modules.shtml#pycrypto


One article about suing paramiko with scp is:
http://www.stillhq.com/python/paramiko/000001.html

Random Solutions  
 
programming4us programming4us