Operating System - OpenVMS
1753502 Members
4665 Online
108794 Solutions
New Discussion юеВ

Re: Getting only SAVESET Header Info

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

Getting only SAVESET Header Info

I want to confirm what's on a backup tape, but I don't need the list of files in each saveset, only the saveset name and the Backup summary info displayed at the beginning of a "BACKUP/LIST saveset" cmd. Is there any way to display only this "header" info?

So far, I've tried various backup list cmds but can't find a combination that does not include the file names.

I've looked at parsing the output from a DUMP saveset/BLOCK=END:1, but I'm not certain of the format/offsets of each field.

Any suggestions?

TIA
22 REPLIES 22
Hoff
Honored Contributor
Solution

Re: Getting only SAVESET Header Info

AFAIK, no.

You can pipe the BACKUP output through SEARCH.

Or build a database that manages and keys off the tape label, or that maintains the contents from the BACKUP journal.

Or tweak the code here:

http://labs.hoffmanlabs.com/node/817
Shriniketan Bhagwat
Trusted Contributor

Re: Getting only SAVESET Header Info

Hi,

First block of the BACKUP saveset contains the summary record. Summary record basically contains the summary information of the saveset, i.e. saveset name, BACKUP command, OS version, user name, account from which the BACKUP was written, block size used etc├в ┬ж.

>> Is there any way to display only this "header" info?
Saveset is like any other file in the disk/tape. To display the header information you need to use the DUMP command as shown below.

$ dump/header/block=count=0
Hope this helps.

Regards,
Ketan
Jack Trachtman
Super Advisor

Re: Getting only SAVESET Header Info

I'm willing to write some DCL to parse the output of a DUMP cmd, but can anyone point me to any information on the record layout of the Backup "header" info? Thanks.
John A.  Beard
Regular Advisor

Re: Getting only SAVESET Header Info

quick and nasty...

$ BACK/LIST=filename saveset.bck/save
$ search/wind=(8,9) filename "Command:"
Glacann fear cr├нonna comhairle.
Hoff
Honored Contributor

Re: Getting only SAVESET Header Info

I do not know what Ketan is referring to here as I don't think the requested metadata is resident in the tape HDR records, and what is referenced in that posting is the ODS header data and not the BACKUP saveset header information.

What I've posted is a link to vmsbackup; some (portable) C code which reads BACKUP savesets on Mac OS X and other Unix boxes, on Linux and on Solaris. Within that C code, you'll find everything that you will need to do here to fetch (just) the BACKUP headers as that code can parse and can display the saveset headers. And see the undocumented BACKUP /ANALYZE qualifier.

If you want to go after the headers yourself, directly, and with DCL (shudder), then you'll be looking at the BCKDEF stuff IIRC.

You could probably SPAWN the BACKUP command and then (after some number of I/O calls or a couple of minutes time) delete the process and rewind the tape. This being a massive hack for a timeout; a way to get just the first part of the tape without having to read the whole thing. And this won't work if there's more than one saveset on the tape. Or punt, and just process the first dozen or so lines of BACKUP /FULL/LIST=file for the tape. I haven't tried this, but BACKUP /FULL /LIST=mbx might work, in conjunction with CREATE /MAILBOX and friends.

Or tweak the provided C code.
Volker Halle
Honored Contributor

Re: Getting only SAVESET Header Info

Jack,

BACKUP/LIST/ANALYZE together with DUMP/BLOCK=COUNT=1 of the saveset should give you enough information about the layout of the 'BACKUP SUMMARY' record.

Volker.
Volker Halle
Honored Contributor

Re: Getting only SAVESET Header Info

Jack,

also see SYS$EXAMPLES:BACKDEF.*

for structure definitions in your preferred programming language...

Volker.
P Muralidhar Kini
Honored Contributor

Re: Getting only SAVESET Header Info

Hi Jack,

>> So far, I've tried various backup list cmds but can't find a combination
>> that does not include the file names.
The BACKUP/LIST command will display the summary information followed
by the listing of the files present within the saveset.
I dont think there is any existing qualifier which would give only the summary
information and not the listing of files within the saveset.

Is the concern that the savesets on tape contain lot of files in it and hence
taking more time to complete the BACKUP/LIST operation?

Regards,
Murali
Let There Be Rock - AC/DC
Jon Pinkley
Honored Contributor

Re: Getting only SAVESET Header Info

Jack,

As others have said, backup itself doesn't (currently at least) provide a way to list only the non-file records. Perhaps you should make a formal request, it should be a relatively easy modification.

As far as parsing the output of the beginning block of the save set, I will only say that the backup header can span more than a single block, especially in the case of image backups. All backup save sets have a SUMMARY record, which has the basic info at the beginning of the listing. In an image backup there is additional volume information saved in the header (record type = VOLUME) and possibly many FID records.

For more detail about what is in the backup save set, use the undocumented, unsupported /ANALYZE switch with /LIST. This will give you a formatted dump of what is in the save set.

The disadvantage of listing is that it can take a long time for large save sets. For examples, an LTO3 filled with many small files can generate a listing file > 1 GB and take more than an hour to generate.

The advantage of listing the save set is that it will provide the totals for files and blocks contained in the save set, computed while backup lists the save set contents. This is similar to what directory/total/size=used gives. It also verifies the readability and consistency of the backup save set. In other words, if you do a complete listing, you will know that the save set is readable, and how much data is in the save set.

One possible way to exclude the file names from a listing of a backup save set is with VMS 8.3+ search /wild

$ search/nowin/wild saveset_listing "[*]*;"," %%%%%%%%%% %%-%%%-%%%% %%:%%"/mat=nor

This excludes strings that are found in the "file" listing lines. The first "[*]*;" excludes the lines that appear to be file specifications, the second is to exclude the date stamps that may have been wrapped to a separate line. The above works only for /brief listings. A perl or awk script could be made more general, but that is left as an exercise for the user.

Letting backup do the work, and filtering the output is the easy way. It works with pipe too.

$ pipe backup/list login.sav; /save | search/nowin/wild/match=nor sys$pipe "[*]*;"," %%%%%%%%%% %%-%%%-%%%% %%:%%"
Listing of save set(s)

Save set: LOGIN.SAV
Written by: JON
UIC: [000002,000016]
Date: 8-APR-2007 02:00:05.15
Command: BACKUP SYS$LOGIN:LOGIN.COM;* LOGIN.SAV/SAV
Operating system: OpenVMS Alpha version V7.2
BACKUP version: AXP72R001
CPU ID register: 80000000
Node name: _SIGMA::
Written on: _$4$DKA200:
Block size: 32256
Group size: 10
Buffer count: 1239


Total of 160 files, 2321 blocks
End of save set

$

If you don't want to wait for the complete listing, then Hoff's source would be the place to start.

Jon
it depends