transfer data from one machine to another

B

bahoo

Hi,

I have ssh access to two linux machines (both WITHOUT root account),
and I'd like to copy data from one to another.
Since the directory structure is different, I want to specify in a
script (ideally in python, because that's what I want to learn) what
to copy over like this:

source: /home/john/folderA
destination: /home/smith/folderB

I'm a newbie on linux and ssh networking and python, so your
suggestions are welcome! A small working example would be appreciated!

bahoo
 
B

Bjoern Schliessmann

bahoo said:
I have ssh access to two linux machines (both WITHOUT root
account), and I'd like to copy data from one to another.
Since the directory structure is different, I want to specify in a
script (ideally in python, because that's what I want to learn)
what to copy over like this:

source: /home/john/folderA
destination: /home/smith/folderB

I'm a newbie on linux and ssh networking and python, so your
suggestions are welcome! A small working example would be
appreciated!

On example machine 10.0.0.1, logged in as john:

scp -r ~/folderA [email protected]:~/folderB

It's IMHO simpler and quicker than developing the same functionality
in Python. Or is there a simple module I overlooked?

Regards,


Björn

Fup2 comp.lang.python

P.S.: Please don't crosspost over hierarchies without setting
followup.
 
R

Rikishi 42

I have ssh access to two linux machines (both WITHOUT root account),
and I'd like to copy data from one to another.
Since the directory structure is different, I want to specify in a
script (ideally in python, because that's what I want to learn) what
to copy over like this:

source: /home/john/folderA
destination: /home/smith/folderB

I'm a newbie on linux and ssh networking and python, so your
suggestions are welcome! A small working example would be appreciated!

Try rsync, if you need a second run, it will only copy what has been
modified in the source.

rsync -var -e ssh /home/john/folderA name@computerB:/home/smith/folderB

Should be enough.
Remove 'v' for less verbose operation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top