Operating System - Linux
1833883 Members
1931 Online
110063 Solutions
New Discussion

Re: read the name of tar file on tape

 
jedd
Advisor

read the name of tar file on tape

hello all, this is going to be a sorry excuse, but i need help in finding the name of the tar file on tape so i can extract. i can list the contents of the tar file. but i need to know the name of the tar file on tape to extract it. or do I???
any help would be appreciated.
contents of tar file with tar -tvf /dev/st0 > /tmp/(name).txt
but i need to know name of .tar
thanks for the help
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: read the name of tar file on tape

find / -name *.tar

It will list every tar file on every mounted filesysetm

tar tv will show by default the contents of a tape.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tom Ward_1
Honored Contributor

Re: read the name of tar file on tape

If the tar was run to tape there is no file name. The device file is the name of the file. It's only when you create a tar file that you have a seperate name. HTH.

Tom
Steven E. Protter
Exalted Contributor

Re: read the name of tar file on tape

If the tar file is on tape the "file" name is the device driver for the tape drive.

The command in my first post will show the contents of the archive.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Francisco J. Soler
Honored Contributor

Re: read the name of tar file on tape

Hi,
if you want to copy all tape files into a file in your filesystem you can do:

dd if=/dev/st0 of=/tmp/tape_file.tar

then you have into /tmp/tape_file.tar all the contents from your tape.

You can list/extract them with the commands:

tar tvf /tmp/tape_file.tar or
tar xvf /tmp/tape_file.tar

Frank.

Linux?. Yes, of course.
peter demus
Frequent Advisor

Re: read the name of tar file on tape

Hello !

if You had stored files on tape with

tar -cvf /dev/st0 /etc

then You could search for some file with

tar -tvf /dev/st0 grep "etc/hp"

for file in /etc beginnging with "hp"

if You found it use

tar -xvf /dev/st0 /etc/hp9000.txt

to restore it. the version on disk will be overwritten !

If You are using Linux the beginning "/" will not be stored so use

cd /
tar -xvf /dev/st0 etc/hp9000.txt

to extract.

bye


jepp!
peter demus
Frequent Advisor

Re: read the name of tar file on tape

sorry it is:

tar -tvf /dev/st0 | grep "etc/hp"
jepp!
Sunil Sharma_1
Honored Contributor

Re: read the name of tar file on tape

Hi,

If i understood your question, you want to know the name of file n which tar stores file in take ot backup media ?

when you take up backup in any backup media the device file name is the name of file, as you know in Unix everything is file.

so there is no other name for tar file...

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Caesar_3
Esteemed Contributor

Re: read the name of tar file on tape

Hello!

When tar is on tape then it has no name,
but if you like the name could be as the
name of tape device.

Caesar