Hans Lambermont wrote:
Diomidis Spinellis wrote:

You can also use ports/net/socketpipe.  For example you can copy a
directory with:

socketpipe -b -i { tar cf -  directory  }  -l  { ssh  remotehost }  -r
{ tar xvf - }

Just curious, what is the advantage of this approach to the following :

tar cf - directory | ( ssh remotehost 'cd targetdir && tar xpf -' )

Something with buffering perhaps ?

The advantage is a performance gain, especially on slower machines. You don't encrypt/decrypt the data, and you don't have other processes read/writing the data. However, because the data is not encrypted, and can therefore be read and modified on transfer, the approach is only suitable for closed, secure networks.

With "tar cf -  dir | ssh tar xf -" your data travels as follows:

 tar   ssh            sshd   tar
  |    ^ |            ^  |    ^
  |    | |            |  |    |
  v    | v            |  v    |
+------------+     +-------------+
|local kernel|---->|remote kernel|
+------------+     +-------------+

With socketpipe, after the initial plumbing, which is performed using ssh, the data travels as follows:

   tar                   tar
    |                     ^
    |                     |
    v                     |
+------------+     +-------------+
|local kernel|---->|remote kernel|
+------------+     +-------------+

The two tar processes directly write to and read from a network socket (hence the program's name).

Diomidis - dds@ - http://www.spinellis.gr
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to