Bill Jonas on Fri, 10 Nov 2000 17:29:24 -0500 (EST)


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

Re: [PLUG] Moving /usr to a new partition properly


On Fri, Nov 10, 2000 at 04:36:21PM -0500, gabriel rosenkoetter wrote:
> (Incidentally, that tar command is the ideal way to move user's home

With all this talk of using tar to back stuff up, I can't help but join in
and throw in Michael Toren's network backup trick.  Note that this is just
a quick little hack and is not designed for security, so take it as such.
I've only used it on a LAN with private addresses behind a firewall; I
wouldn't dream of using it out there on the Internet, or between public IP
addresses.

On the receiving side:
$ nc -v -v -l -p $port | gunzip -c | tar xvpf -

On the sending side:
$ tar cvpf - <dir> | gzip -c | nc -v -v -w 2 remotehost $port

Works great for quickly copying a directory structure from one machine to
another.  ('nc' is what Debian calls their netcat binary.)  Why not just
use scp?  Because it's noticeably, significantly slower at 10Mbit speeds or
higher.  Straight FTP would be a major pain in the ass at preserving
directory structure and permissions.  Perhaps if you run an ftpd that
allows you to grab a directory with <dirname>.tar or <dirname>.tar.gz it
would be somewhat easier, but I still don't see it preserving ownership or
permissions that well.

BTW, a minor point with your recommended command: The Tips-HOWTO
recommends:

$ (cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)

On the right-hand side of the pipe, you have a ; instead of &&.  I would
recommend the && as a "just in case" measure.

-- 
Bill Jonas                | "If you haven't gotten where you're going,
bill@billjonas.com        |  you aren't there yet." --George Carlin
http://www.billjonas.com/ |  http://www.harrybrowne.org/


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug