Back-up on remote machine

Roger Merritt mcrogerm at stjohn.ac.th
Thu Aug 5 03:58:30 PDT 2004


I've been playing with this for a while. I need to add a small (4 GB) hard 
drive to one of my servers. Partly because I need more storage space, 
partly because I think there's something wrong with the present hard drive 
-- I get page faults while in kernel mode (fatal signal 12, I think it is) 
and spontaneous reboots when I try to build world on this drive (or make 
index, or upgrade some ports, etc.).

What I want to do is copy my whole /usr/home directory tree to another Free 
BSD machine down the hall, pull the current hard drive (4 GB) out, put the 
new hard drive with a fresh build of Free BSD in the box as the master 
drive, reformat the old drive, and finally, copy the /usr/home directory 
tree back to the old hard drive and mount it separately as /usr/home.

I've found directions that almost fit my needs, but not quite. What I would 
like to do is tar the directory tree and pipe it to either scp or ssh. What 
I don't want to do, because I don't think I have enough room, is make a tar 
file on the old machine. One example I found on the WWW is: tar -czf - 
/some/file | ssh host.name tar -xzf - -C /destination.

That's not quite what I want, because I don't see any need to untar 
everything at the far end, but I can't send a file without using some 
command to ssh. I thought tar -czf - /some/file | scp - 
name at remotehost:somefile.tar.gz, but it doesn't seem to work. Can anyone 
point out where I'm going wrong? I guess if I have to I can untar the 
directory tree to some temporary place on the remote host -- that one has 
plenty of room on it, but it seems like an inelegant solution. That's 
really my only objection to it.

-- 
Roger



More information about the freebsd-questions mailing list