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

Backing up to a remote machine using ssh

0 views
Skip to first unread message

doug reeder

unread,
Jan 16, 2001, 2:37:12 PM1/16/01
to

I'm using cpio to back up to an On-Stream DI-30 tape drive. (tar
works on our machines, but lacks per-file CRCs. Dump and Amanda don't
work with our system, perhaps because of flaws in ide-tape. BRU
requires one copy per machine, which would be rather expensive.) The
DI-30 requires that the blocksize be 32k. (We're running Red Hat 6.1
on a half-dozen HP Kayaks and Visualizes.)

Backing up locally (the machine which has the tape drive) works fine.
Backing up remotely using rsh (implicitly) works fine:

find . -path '*/.netscape/cache' -prune -o \
-print | cpio -ov -H crc --block-size=64 -O backup@tactus:/dev/nht0

I would really like to use a more secure way to do remote backups,
given the security holes of rsh. Ssh is the obvious replacement. I
have ssh working fine for remote logging in and remote command
execution (and passwords don't need to be entered, because I have
ssh-agent running). However, weird things happen when I try to do
backups using cpio, ssh, and dd:

find ... cpio -ov -H crc --block-size=64 -O /usr2/website4.cpio

produces a good archive locally.


cat /usr2/website4.cpio | ssh tactus dd bs=32k of=/usr2/website4.cpio

properly copies the archive file to tactus (the machine with the tape drive).


On tactus,

dd bs=32k if=/usr2/website4.cpio of=/dev/nht0

properly copies the achive file to tape. So, all the steps can be
individually done (for an archive small enough to store in a file).
An archive of an entire machine is too big to manipulate this way.
Obviously, I'd like to do the backup straight to tape.


On the first machine

cat /usr2/website4.cpio | ssh tactus dd bs=32k of=/dev/nht0

produces the errors:
dd: /dev/nht0: Invalid argument
error: Broken Pipe


cat /usr2/website4.cpio | ssh tactus dd bs=32k of=/dev/tape

produces the errors:
error: Broken Pipe

which is odd because /dev/tape is a hard link to /dev/nht0:
[root@tactus /root]# ls -l /dev/*ht* /dev/tape
crw-rw---- 1 root disk 37, 0 May 5 1998 /dev/ht0
crw-rw---- 2 root disk 37, 128 May 5 1998 /dev/nht0
crw-rw---- 2 root disk 37, 128 May 5 1998 /dev/tape

Any suggestions for making cpio, ssh, and dd all play together?
--
P. Douglas Reeder Lecturer, Computer. Science. Dept., Ohio State Univ..
ree...@cis.ohio-state.edu http://www.cis.ohio-state.edu/~reeder/reeder.html
GE/S d+ s+:- a C+@$ UH+ P+ L E W++ N+ o? K? w !O M+ V PS+() PE Y+ PGP- t 5+ !X
R>+ tv+ b+++>$ DI+ D- G e+++ h r+>+++ y+>++

Michael Heiming

unread,
Jan 17, 2001, 9:40:31 AM1/17/01
to
Hello,

doug reeder wrote:

I use this for tar backups over ssh direct on tapes (scripted)

tar --create --verbose -b 128 --block-number --exclude-from=.exclude-data \
--label "Level-${LEVEL} Backup ${NOW}" \
${BACKUPFILES} | ssh ${DEST} "cat - > /dev/tape"

You should be able to adopt it for your needs.

Good luck

Michael Heiming
Sysadmin
--
__ __ __ Virtueller Bau-Markt AG
\ / [__) [__] [ __ Meerbuscher Strasse 64
\/ [__) | | [_./ 40670 Meerbusch
www.vbag.de Michael Heiming (m...@vbag.de)

0 new messages