Copying files between 2 Unix server

Is there a simple way to copy data from one server to a different server?

Seems that if 2 servers are on the same network, there should be a simple way to copy between the two.

Not just one file. I need to copy a whole directory with subdirectories from one server to a different one.

I have a tape drive in each server, however, tapes created on the older server cannot be read by the newer server. UGH!!!

I thought about ftp but there isn't a recursive ftp command that I know of.

Please just shoot me!

FTP works great using the recursive option.

I mostly use SSH, however, for all machine to machine copies.

(used to be free for unix-based systems, not sure now, but get the lastest version... older versions had some security problems...)

There is a recursive option for ftp ???

Docboyeee,

You could also use the "tar" command to archive the multiple files into a single file. This file could then be copied to the 2nd server with the utility of your choice (e.g. FTP).

If the file is large, you may want to consider compressing it with a program like "gzip" prior to the transfer.

Good luck!

Biker
Systems/Network Administrator
LiveFire Labs - Hands-On Technical e-Learning

you can use ftp (with a shell prg ) with correct configure !
what kind of unix did you use?

rcp works recursively you'll need to look into .rhost

a tar and compress followed by and ftp would probably do you the best

system A <-> system B

rcp for non-interactive use system B needs a valid IP@ or hostname for systemA in ~/.rhosts (chmod 600 ~/.rhosts), with -r recursive get/put
rexec for non-interactive use system A needs a valid entry in the ~/.netrc file with username and password (machine systemB login username password userpassword init macdef)
ftp non-recursive
ncftpget can do recurseive FTP get with -R
ncftpput FTP put, similar to ncftpget
wget can do recursive HTTP get with -r
ftpcopy can do recursive FTP
curl can do a lot of stuff :wink:

You can also mount a NFS filesystem from the other host to your local and do the traditional (in this case with Kornshell):

cd /nfsmountedfilesystem
tar cf - .|(cd /localfilesystemtocopyto&&tar xvf -)

Or why not pipe trough rsh:

rsh "cd /directory&&tar cf - ."|(cd /localdirectory&&tar xvf -)

However if this needs some padding and fiddling depending on rsh/rshd implementations.

:slight_smile:

I need to do this same thing (copy an entire directory from one server to another)

Did you get an answer? If so, what was it?

A couple of solutions...

Recursive FTP -- here at last.

NFS mounting is my favorite way other than SSH to do this type of copy...

But i use this command... when I had to copy a 26GB filesystem...

From the tar manpage:::

cd fromdir ; tar cf - . | ( cd todir ; tar xf - )