Views:


Step By Step



Getting a list of files from a physical tape or disk directory file

The scenario:

You have a volser (either a physical tape or a disk directory file) that the catalog has no information for, and you would like to know what files were backed up to it.

Whether you intend to use tape mode restore to retrieve data from this volser (with the properly specified pattern matching of course) or just want to decide if you can reuse a tape for other data, what you really want is a list of files that it contains.


The problem:

From the DPX GUI, there is a scan tape function which will allow you to list what is on a physical tape. However, this only shows a block of files at a time, and you must repeatedly hit the scan button to get the next block. Also, the list of files is displayed on screen, so you cannot use string searching utilities to find what you are looking for. This function only applies to physical tapes, so you cannot use it for disk directory volser files.


The solution:

Download the bexrt tool from the mysupport site from https://mysupport.catalogicsoftware.com/product.php/market/bexrt.zip 


DPX provides a standalone utility bexrt which is intended to be used to restore data from DPX tapes. It is usually mentioned to prospective new users as the "fall back method" to retrieve data in the unlikely event that they chose not to license the product but have a month's worth of data backed up during their trial period. Although the primary purpose of bexrt is to restore files, you can get a bona fide list if files on the tape written out to a plain text file. Once you have this file, you can use your favourite text editor or standard string searching utilities to determine what is on the tape. For example, you want to know if a particular file is on this tape, just grep or search the text file for the file name. Once you find it, you will know exactly what needs to be used for a tape mode restore pattern to match it. In addition, you can use this text file as a means to positively determine that your backup job has actually backed up what you wanted it to, rather than poke around in the DPX GUI at the restore browse screen. You can specify a disk directory volser file as the source device and it will work in this mode also.


If you use "bexrt -h" you can get a list of parameters. 

Please note the example given in this case is for the tape device server being a Solaris machine. Please refer to the parameter explanations for how these apply to other file systems and/or device server types. The parameters are relative to the machine you are running bexrt from, it is not important what kind of file system was backed up on the tape itself. See also the additional examples at the end of this page.

Please note that the tool must be run from the  DPX/bin directory, otherwise errors may occur.

./bexrt -f /tmp/xyz -I . -l -p 0 -t /dev/rmt/0 / /tmp

Here is what the parameters mean:

-f /tmp/xyz Specifies that the file list will be written to a file /tmp/xyz. Any existing file with that name will be overwritten. This example is for a Unix device server, for a Windows device server you would use something like "-f C:\TEMP\xyz.txt".

-I . (Upper case i) This is literally saying to match files and directories with the exact name of "." (dot) which is unlikely to match anything. By default, if you don't specify this parameter it will match everything, like "-I *", but the output to the file is more usable for the "skipped" entries rather than the "matched" entries (try it, you will see what I mean), so the idea is to prevent matching anything. You can use something other than "." if you like. This parameter is the same for all types of operating systems.

-l (Lower case L) Specifies to list the files only not actually restore anything. This is the same for all operating systems.

-p 0 This specifies using partition zero, which will start with partition 1 and continue with each partition until it reaches the end of the tape. You can also specify a specific partition number if you like. This is the same for all operating systems. If you are reading from a disk directory volser file, be sure to specify "-p 1" for partition 1, rather than "-p 0" to scan all partitions.

-t /dev/rmt/0 This specifies the locally attached tape drive to use, or disk directory volser file to read. You must get the tape into the drive yourself before running this command, it expects the tape to be in the drive. Note that to read a tape it is not required to specify a specific compression mode device, as in /dev/rmt/0c (for Solaris), since reading a tape will always use the density format that was used to write the tape. Using the rewind on close device (in other words not the /dev/rmt/0n device) just means that when bexrt is finished it will rewind the tape before the program exits back to the command prompt. This parameter will be different for your particular operating system type and tape device to use. For example on Windows this would likely be "-t \\.\tape0". If you are reading from a disk directory volser file, specify the full path to the file with "SYNC" appended to the end of the file name. For example, if the disk directory file is in /backex/diskdirectory/dsk001, the parameter would be "-t /backex/diskdirectory/dsk001SYNC"

This specifies the "disk" to restore files to. For Unix, specify the root directory this way. For Windows, you would put C: or something like that. Note!!! It does not matter what you put, as long as it is a valid disk. You are not restoring anything at all, only listing files. If I had written this utility I would have not required this parameter for list mode but alas the writer did not think the same way I do... :^)

/tmp This specifies a directory below the specified "disk" to restore files to. Again, we are not restoring anything, so it does not matter what you specify. For Unix, "/tmp" is a good choice. For Windows, use "\".

You will get output to the screen where you run bexrt, which looks a lot like a data mover log file. Ignore all this.

In the specified output file (/tmp/xyz in the example), the contents will look like this:

BEX Restore Tape Utility Report
Skipped file: \
Skipped file: \ffastun.ffa
Skipped file: \ffastun.ffl
Skipped file: \ffastun.ffo
Skipped file: \ffastun0.ffx
Skipped file: \liprefs.js
Skipped file: \Minutes May 2002.doc
Skipped file: \web pages
Skipped file: \web pages\teleinterface.html
Skipped file: \Tax Info
Skipped file: \Tax Info\Tax2000
Skipped file: \Tax Info\Tax2000\Tax Year 2000.tax
Skipped file: \Tax Info\Tax2000\32bit
Skipped file: \Tax Info\Tax2000\32bit\ctg
Skipped file: \Tax Info\Tax2000\32bit\ctg\win309.bmp
Skipped file: \Tax Info\Tax2000\32bit\ctg\win322.bmp
Skipped file: \Tax Info\Tax2000\32bit\ctg\win323.bmp
Skipped file: \Tax Info\Tax2000\32bit\ctg\win324.bmp


and so on. Note that this example is from a Windows backup, so the slashes are Windows style. For Unix or Novell, the paths would use forward slashes.

Once you have this file, you can strip off the leading "Skipped file:" prefixes with a simple Unix cut command to strip off the first 14 chars, to make it look nicer. Or just leave it as is, and ignore the prefix. Either way, you can easily peruse the file list and search for specific files by name or pattern.


Caveats:

Once you start bexrt, it runs until it reaches the end of the tape (if you specify partition zero) or the end of the specified partition. If you want to stop it, you will have to kill it with SIGKILL (kill -9 in Unix), it happily ignores SIGINT (control -c) and SIGTERM (regular kill).

If you specified the rewind device (as in /dev/rmt/0), it waits until the tape has rewound before giving you back the command prompt when it is finished.

If you accidentally forget the -l parameter to tell it to list only, be ready to clean up the files that get created under the disk and directory you specified...

 

Here is an example of the syntax for a Windows device server. The only parameters you would have to edit to match your particular machine is the tape device (for example \\.\tape0 would be the first tape drive on the machine) and the -f parameter to specify the location of the output file. No need to change any other parameters.

bexrt -f C:\TEMP\xyz.txt -I . -l -p 0 -t \\.\tape0 C: \

 

Here is an example of the syntax for a Windows disk directory volser file DSK000 in the directory C:\DISKDIRECTORY. The only parameters you would have to edit to match your particular case is the path to the disk directory volser file and the -f parameter to specify the location of the output file. No need to change any other parameters. Note the partition is set to one, and the filename has SYNC appended to the end.

bexrt -f C:\TEMP\xyz.txt -I . -l -p 1 -t C:\DISKDIRECTORY\DSK000SYNC C: \

 

Here is an example of the syntax for a Unix disk directory volser file DSK000 in the directory /backex/diskdirectory. The only parameters you would have to edit to match your particular case is the path to the disk directory volser file and the -f parameter to specify the location of the output file. No need to change any other parameters. Note the partition is set to one, and the filename has SYNC appended to the end.

bexrt -f /tmp/xyz.txt -I . -l -p 1 -t /backex/diskdirectory/DSK000SYNC / /tmp