Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Back-up on remote machine

1 view
Skip to first unread message

mcro...@stjohn.ac.th

unread,
Aug 5, 2004, 6:58:43 AM8/5/04
to
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@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

_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"

jo...@jodocus.org

unread,
Aug 5, 2004, 7:51:43 AM8/5/04
to
On Thu, Aug 05, 2004 at 05:58:24PM +0700, Roger Merritt wrote:
> 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.

If all you need is somthing at the other end capturing the data try

... | ssh remotehost "cat - > myfile"

--
greetz Joost
jo...@jodocus.org

iacc...@ibctech.ca

unread,
Aug 5, 2004, 9:32:33 AM8/5/04
to
> On Thu, Aug 05, 2004 at 05:58:24PM +0700, Roger Merritt wrote:
>> 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.
>
> If all you need is somthing at the other end capturing the data try
>
> ... | ssh remotehost "cat - > myfile"

Remember though, that the remote file will be a tarball itself. Here
is the command I use frequently, to get exactly what you want...a
tarball of a local file system on a remote machine:

# tar -cvzf - /home/steve | ssh steve@server 'cat > tarball.tar.gz'

Regards,

Steve

0 new messages