Question : UNIX TAR command

I wanted to extract file25  from tape on /dev/rmt/3m on serverA(no space) to serverB(space).  The reason I need to do a SSH is space related.

A) The following allows me to read from SERVERB - the server with all the space.

SERVERB > ssh SERVERA dd if=/dev/rmt/3m |tar tvf 

B) I have the following to extract BUT  (1) I get disk checksum errors (2) I only want file25
SERVERB> ssh SERVERA dd if=/dev/rmt/3m |/usr/bin/tar xvf -
I
 believe it is the dd command, but I don't know how to re-write without the dd command.  I have tried the following:

FROM SERVERA - no space here
SERVERA >> nohup tar xvf - filename /dev/rmt/3m  | ssh SERVERA "cd /tospaceDIR" &

Answer : UNIX TAR command

If you have the rsh set up to allow passwordless connection from SERVERB to SERVERA, and the rmt program on SERVERA, you could use

SERVERB> tar xv --file user@SERVERA:/dev/rmt/3m file25

where  "user" is the required userid on SERVERA.

If you don't (or can't - it's a security hole) have rsh  set up, then "B)" is closest to what you want.  To avoid checksum errors, you might have to specify the blocksize on the dd command (for example, bs=512 if the tar was created with 0.5k blocks).  To extract only file25, just add "file25" after the hyphen, so that tar command becomes "tar xvf - file25".

Are "tar" and "/usr/bin/tar" different?  Run "which tar" to see the default (you may have Posix and non-Posix versions of tar installed).  It looks as though the one fiound first in the PATH works better than /usr/bin/tar.
Random Solutions  
 
programming4us programming4us