Hi guys,

Persuant to a suggestion that I should not be trying to backup machines
using tar over NFS as it can lead to probs (such as root on the remote
machine not being able to read the machine to backup) I have been trying
to get tar over ssh going.

This was the problem I had.....
Date: Sun, 7 Oct 2001 09:29:00 +1000
\begin{Mike Lake}
> I am having a problem getting tar to backup one machine (martel) which 
> has it's home directories NFS exported to the machine with the tape
> drive on it (tazieff). The prob is basically that root cannot read
> some
> files as it seems the uid/gid numbers don't match between the
> machines.

Angus wrote....
> tar has support for reading over rsh (or ssh).
> since NFS authentication is IP-based, rsh should be no less secure. ssh
> would obviously be the best alternative.
> it'll be much nicer on the network, avoid permission issues, etc if you
> use that method instead of NFS.

so I am now using ssh. I did a search on google and it suggested a few
ways. Most were just ssh'ing an already created tar file across to the
backup machine. What I want is a stream of data from the machine to
backup to the machine with the tape drive on it. That way I won't run out
of diskspace sometime.

I have authorized keys on both machines so root can login using ssh with
no passwd and I have changed the /etc/ssh/sshd_config file to allow root
logins via "PermitRootLogin yes" (slug archives helped there !)

This is the script that runs:
-----------------------
root:# cat test
#!/bin/bash

# This is what will run when it all works :-)
#ssh root@martel 'tar cvf - /home' | dd > /dev/rmt0

# This is here for testing, testing dir contains a few files
ssh root@martel 'tar cvf - /home/mikel/testing' 
-----------------------

The problem is that when ssh logs into root .bashrc & .profile gets run
and there is some output from the login shell. This is prepended to the
tar file so its not a tar file anymore. I can see the lines of the login
if I run "/test | more". 

This is what I want to do: Backup all home directories on the Alpha
by streaming the contents via ssh or scp to the backup machine with 
the tape drive. The script would be started FROM the backup machine with
the tape drive on it.

Question: 
How do I stop the login stuff from prepending to the tape.?
Is there a better way to pipe tar through ssh or use scp? so
that it streams from the Alpha to the tape machine.

Mike
-- 
--------------------------------------------------------------------
Michael Lake
Active caver, Linux enthusiast and interested in anything technical.
Safety Convenor, Australian Speleological Federation
Owner, Speleonics (Australia)  <^~^::^~^>
--------------------------------------------------------------------

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to