[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: copying files from home directory on one machine to directory on another machine



On Sunday 29 November 2009 12:23:47 Dave Witbrodt wrote:
> > That's right. I've never used either tool before. Thanks a lot for
> > the tip!
> 
> Sure.  If you're in the mood to learn about every possibility...
> 
> You might also consider NFS:  [...]

Okay, if every possibility is what you want to learn you cannot miss the 
excellent combination of nc and cpio:

On your target (bob):
% cd targetdir
% nc -l -p 6060 alice | cpio -iv

On your source (alice):
% cp sourcedir
% find -print0 | cpio -ov0 | nc bob 6060

nc is short for netcat, it will listen on bob (-l) on port 6060 (-p 
6060) for alice. The input comes from bob, who is sending the message 
via nc. In short it's like a pipe over the network (unencrypted, use 
cryptcat if your network is not trustworthy). cpio (copy in / copy out) 
does the actual data transfer. On bob the mode is copy in (-i) and on  
alice it's copy out (-o). To see what's being transferred you can use (-
v). Finally, you can use find (-print0 / -0) to pipe the names of files 
to be transferred to cpio.

Have fun ;-)


Reply to: