List of files on a tape

List of files on a tape

Post by Tim Sutto » Wed, 08 Jul 1998 04:00:00



Is there a way to list (or at least count) the number of files on a tape?  I
have a device (/dev/rmt0h) and would like to see what files are on it.

Regards

Tim.

PS. Hey Garry.  I removed 'VCF' from my post.  Perhaps I'm coming into the
real (unix) world.
--
Tim Sutton - Database Administrator
UBD Group
PO Box 11264
Ellerslie
Auckland
NEW ZEALAND
PH: 64-9-526-9142
FAX: 64-9-526-6310

 
 
 

List of files on a tape

Post by BIZO » Wed, 08 Jul 1998 04:00:00


Quote:>Is there a way to list (or at least count) the number of files on a tape?  I
>have a device (/dev/rmt0h) and would like to see what files are on it.

>Regards

>Tim.

>PS. Hey Garry.  I removed 'VCF' from my post.  Perhaps I'm coming into the
>real (unix) world.
>--
>Tim Sutton - Database Administrator
>UBD Group

Depends on what was used to create it. If you used tar, try "tar -tvf
/dev/rmt/0h" - it will send the output to stdout (you could also redirect it to
a file). Also, don't forget to write protect the volume, just in case.
Not sure if fbackup has a similar option; check the man page.
We use CA-Unicenter for some of our backups - it has something called asm510
which I've found very handy.


#=================================

#=================================

 
 
 

List of files on a tape

Post by AD13 Weissmann. » Wed, 08 Jul 1998 04:00:00



> Is there a way to list (or at least count) the number of files on a tape?  I
> have a device (/dev/rmt0h) and would like to see what files are on it.

for tar archives:
tar tvf /dev/rmt0h

tar gzipped tar archives:
gunzip -dc /dev/rmt0h | tar tvf -

i hope it is an tar-tape.

Quote:

> Regards

> Tim.

w. weissmann

Quote:

> PS. Hey Garry.  I removed 'VCF' from my post.  Perhaps I'm coming into the
> real (unix) world.
> --
> Tim Sutton - Database Administrator
> UBD Group
> PO Box 11264
> Ellerslie
> Auckland
> NEW ZEALAND
> PH: 64-9-526-9142
> FAX: 64-9-526-6310

--

$ drink <bottle; opener
bottle: cannot open
opener: not found

 
 
 

List of files on a tape

Post by (Paul » Wed, 08 Jul 1998 04:00:00


And for cpio tapes try:

cpio -itvcB </dev/rmt0h

the "t" means list, the "v" means verbose output(looks like ls -l),
the "c" means lower byte ascii headers, and the "B" means default
block size. You may need to play with the block size. If so then
substitute the "B" for "C32768" to try a block/character size of
32768bytes.

and pipe to "wc -l" to return the number of files on the archive.

Err, theres always "dd" as well.

Paul.

On Tue, 07 Jul 1998 09:00:41 +0200, "AD13 Weissmann.W"



>> Is there a way to list (or at least count) the number of files on a tape?  I
>> have a device (/dev/rmt0h) and would like to see what files are on it.

>for tar archives:
>tar tvf /dev/rmt0h

>tar gzipped tar archives:
>gunzip -dc /dev/rmt0h | tar tvf -

>i hope it is an tar-tape.

>> Regards

>> Tim.

>w. weissmann

>> PS. Hey Garry.  I removed 'VCF' from my post.  Perhaps I'm coming into the
>> real (unix) world.
>> --
>> Tim Sutton - Database Administrator
>> UBD Group
>> PO Box 11264
>> Ellerslie
>> Auckland
>> NEW ZEALAND
>> PH: 64-9-526-9142
>> FAX: 64-9-526-6310

 
 
 

List of files on a tape

Post by Kurt J. Lanz » Wed, 08 Jul 1998 04:00:00



> Is there a way to list (or at least count) the number of files on a tape?  I
> have a device (/dev/rmt0h) and would like to see what files are on it.

I would start with the man page of the program used to write the tape in
the first place. To the best of my knowledge, every one of them has a
set of option switches which will produce a listing of the tape's
contents. But it does no good to write a tape with A and try to list its
contents with B. So, what was it written with?
 
 
 

List of files on a tape

Post by Robert Wolte » Thu, 09 Jul 1998 04:00:00



> Is there a way to list (or at least count) the number of files on a tape?  I
> have a device (/dev/rmt0h) and would like to see what files are on it.

It depends on how you (or someone) created the tape.
If it was a tar command, try

tar -tvf /dev/rmt0h

This will test and list the files

Cheers, Robert

 
 
 

List of files on a tape

Post by Garry Garre » Thu, 09 Jul 1998 04:00:00



>PS. Hey Garry.  I removed 'VCF' from my post.  Perhaps I'm coming into the
>real (unix) world.

I must have been in a really bad mood.  :-)

I doubt I was intending to rant at you for having the VCF file, but
more likely I was ranting at MS's stupidity for creating the darn
thing in the first place.  Haven't met an MS e-mail product I like
yet.  :-)

--
-----------------------------------------------------------------------
Garry J. Garrett              
CSG Systems, Inc.      ._o    see my homepage for a "mailto:" tag
2525 North 117th Ave.    |>   to send me e-mail...
Mailstop 2-A             4    
Omaha, NE 68164-3679          

CSG Systems - http://www.csgsys.com/
My Homepage - http://monarch.papillion.ne.us/~ggarrett

I do not speak in any capacity on behalf of CSG Systems.
I get into enough trouble speaking for myself.  

 
 
 

List of files on a tape

Post by Jim Denni » Sun, 12 Jul 1998 04:00:00


: > Is there a way to list (or at least count) the number of files on a tape?  I
: > have a device (/dev/rmt0h) and would like to see what files are on it.
: >

: It depends on how you (or someone) created the tape.
: If it was a tar command, try

: tar -tvf /dev/rmt0h

: This will test and list the files
: Cheers, Robert

        Six answers so far and not one made the distinction
        between *tape* files (members) and files contain in
        *archives* that are on the tape.

        To find out how many "thingies" (members, tape files)
        are on a tape I use the 'mt eod' command on the
        non-rewinding device node, followed by the mt stat
        command.  This should tell you how many "filemarks"
        are between the BOT (beginning of tape) and the "eod"
        (end of data). It should also tell you what the offset
        into the tape you're at (or you can use the 'mt tell'
        command for that).

        Given that number you can use the mt fsf (file seek forward)
        and related commands to seek to the tape member that
        you're interested in.

        If you don't know what type of file this is try, the following
        command:

                head /dev/st0 | file -

        (or equivalent, as appropriate to the device names on
        your *ix).

        Under Linux at least, this accurately distinguishes between
        cpio, tar, gzip'd tar, dump and Amanda tapes.  I presume
        that it would return "data" as the file type for anything
        it doesn't recognize.  It will return an error on a
        blank tape (as will some of the mt commands).

        *THEN* you can use the various commands described in this
        thread to list the members of a given (identified) archive
        (member) on the tape.

        Incidentally I bring this up because it was one of the
        more confusing things I've encountered while trying to
        learn Unix.

--
Jim Dennis,
Starshine Technical Services            http://www.starshine.org