Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying to pull info from a tape 2

Status
Not open for further replies.

tated

Technical User
Dec 18, 2000
6
0
0
US
I'm trying to pull info from a tape backup ( i don't want to restore the data i want to back it up to a directory to archive ) I'm guessing i will use the cpio however i'm not sure of the options.

Thanks
 

Before you attempt to extract data from a tape archive, you probably want to be sure what format the archive is in, cpio, tar etc ...

I beleive their is a way to check the format type.

Maybe someone else has more details on that.

-Danny






 
you can use:

dtype /dev/<your_tape_device>

to tell you what type of format the data is in on your tape.

Have Fun!
Chuck
 
the file is in tar format, what would my next step be if i want to then pull the info from the tape and archive it
 
Next thing to find out is if the tar archive is in absolute format:

/dir/filename

or in relative format:

./dir/filename
or
dir/filename

If it's in relative format, you're in good shape for restoring to a directory of your choice, but if it's in absolute it's a little more difficult (not impossible) to do if you want to restore in another directory other than the format on the tape.

to check the tape type:

tar -tvf /dev/<your_tape_device_name>

If it is in relative, then:

cd /dir_of_choice
tar -xvf /dev/<your_tape_device_name>

and your in business. But, if it's in absolute, you might be able to use the pax command (that's if it is installed on your version of SCO) to change the format from absolute to relative during the restore. Very tricky to do, but it CAN be done. If you have the pax command installed, check the man pages for the syntax.

Have fun!
Chuck
 
According to 'man tar' the function modifier 'A' removes the leading / if the path is absolute, hence changing it to relative.

tar -Axfv /<your_tape_device_name>

Roy Thomas
 
True, I have to remember this is SCO. I favor AIX and it does not have that functionality with tar, which is why they recommend to use the pax command. But, I do remember that the tar that comes default with SCO does offer that.

Chuck
 
i replyed to the wrong string the first time


when i use tar -tvf /dev/tape from the directory i want to archive the files in, the reverse happens and the files in the
directory are tar'd up and written to tape
 
Are you sure??? When you issue the command:

tar -tvf /dev/<your_tape_device_name>

and it lists the files, does it show an &quot;a&quot; in front of the files listed or does it show the permissions of the files? If it shows the permissions of the files, then it's NOT archiving to tape, just listing the toc of the tape which is what the t flag is supposed to do.

Chuck
 
you are correct the file is not being written to the tape, what it is doing is listing a file i have saved in another directory that is in the .tar format.

tar: blocksize =20
rw-r--r-- 0/3 11228905 ( then is list the directory and a random file that is in the .tar format )

#
 
Is this the primary tar device? Then modify the /etc/default/tar file to show on the last line &quot;archive=/dev/devicename 20 0 y&quot; like shows in archive 8 or 12 or wherever the tapes show on your version.
Directory then becomes tar tv (dash not required) archive becomes tar cv and extract becomes tar xv.
Do a tar tv on your file. if file show path ./whatever then you are absolute. then go where you want to put it and do the tar xvA as described above.
If not absolute go where you want it and do tar xv

Ed Fair
efair@atlnet.com

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

 
I made this adjustment

Is this the primary tar device? Then modify the /etc/default/tar file to show on the last
line &quot;archive=/dev/devicename 20 0 y&quot; like shows in archive 8 or 12 or wherever the tapes show on your
version.
Directory then becomes tar tv (dash not required) archive becomes tar cv and extract becomes tar xv.
Do a tar tv on your file. if file show path ./whatever then you are absolute. then go where you want to put it and do
the tar xvA as described above.
If not absolute go where you want it and do tar xv

and now i get

xv /dev/tape
tar: 1 file (s) not extracted
#
 
do a tar tv should give you the contents
tar xv /dev/tape upchucks because you don't have a file /dev/tape on the tape
so get a list and post the first 5 or so file names here and we'll work with them
or get a total listing by tar tv > tapefiles which will create a file with full details

Ed Fair
efair@atlnet.com

Any advice I give is my best judgement based on my interpretation of the facts you supply.

Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top