LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy files from machine1 to machine2 (https://www.linuxquestions.org/questions/linux-newbie-8/copy-files-from-machine1-to-machine2-759029/)

Dominique1956 10-01-2009 01:03 PM

Copy files from machine1 to machine2
 
Hello,

I am trying to copy files from a machine1 to a machine2. I was looking at a thread of 2006 they were using nc but so far i could not find this command.

Any new command or other way to do the copy?

Thanks,
DOm

lazlow 10-01-2009 01:10 PM

How are the two machines connected? NFS, Cifs, etc.

mirjeddi 10-01-2009 01:12 PM

Hi

Yes you can use scp,rsync commands to copy files from a machine1 to a machine2.

sploot 10-01-2009 01:15 PM

they are connected by a router, yes?

turn sshd on for both the remote computer.

Code:

rsync -rvP user@remoteComputerIP:/where/your/file/is /where/you/want/it/to/go/
This should do it. :)

Or you could try scp, but scp won't recover from errors like rsync will, so I suggest rsync.

Also, read the man pages on rsync to get more info on options.

Good luck!

ptrivino 10-01-2009 01:18 PM

rsync is good for copying files
 
I have to copy files between servers all the time. If you need a bunch copied, use rsync:

rsync -avP --exclude="/proc" root@<server>:/ .

The above will copy all files from <server> to the current directory (the dot), excluding the /proc directory. Look at the man page for rsync to see what the "-avP" options do.


All times are GMT -5. The time now is 02:34 PM.