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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scanning automatically?

Status
Not open for further replies.

davevail

Programmer
Mar 16, 2002
24
US
Hi all - I am still somewhat of a "newbie" to Networker, so be nice - we would like to run the scanner utility to scan all the tapes in our library to look for bad tapes, we have over 400. A looping script was thought of, but we want to vary the drives it runs on. The tapes are also missing some of the sequential #'s - has anyone done anything like this? Thanks in advance! (we are running 7.2.1)
 
The scanner command retrieves missing file and media index information which you should have present and which will be backed up automatically at least once a day. So why do you want to run scanner at all?

It is not intended to scan a bunch of media at all, although this could be made possible of course.

Keep in mind that, in case scanner will detect an error, it will most likely not proceed. Consequently, a script will stop here.

But most important:
Scanner will not be able to detect everything. And what you will discover depends very much upon the type of error:
- If it is a media read error, the drive should already detect it (thanks to CRC/ECC) and come up with a read problem.
Can you move beyond this point - the answer most likely depends on the error type.
- If there is an error in the file (changed data, but fine checksums, which already is hard to believe), then no product will be able to discover it.
- If it is a problem on the block header (again, changed data with checksums o.k.), NetWorker will come up with problems during the scan. Most like it will fail to recover the save set as well.

Sit down on a test system and backup a larger text-only file (1MB is enough) to a standard (not advanced) file device. Then, with a hex editor, manipulate the file and try to run scanner and recover
- Manipulate the file data
- Run "scanner -i -S ssid" and "recover -S ssid"
I bet you will not see any problem at all!

- Now manipulate a block header (they are embedded but can
easily be detected)
- Run "scanner -i -S ssid" and "recover -S ssid" again
Most likely you will see errors here.

So what you really need to do is a test-read (recover -n) for each save set!!! to see whether all data can be retrieved fine.

But before you go and script something, make sure that you will be able to detect what you are after.

Good luck.
 
Here is a sample perl script to generate the shell script you want:

# Generate script to scan all tapes
# assuming 2 drives are available
# usage : perl genscan.pl >script.bat
#
my $slot; # slot number
my $server="NWSERV2"; # server name
my $min_slot=200; # first slot to scan
my $max_slot=382; # last slot to scan
my $tape; # tape name
for ($slot=$min_slot; $slot<=$max_slot; $slot++)
{
$tape="\\\\.\\Tape0";
# load tape without mount
print "nsrjb -s $server -n -l -S $slot -f $tape\n";
# scan tape without updating indexes
print "scanner -n -i $tape\n";
# unload tape
print "nsrjb -s $server -u -f $tape\n";
# same with next drive ...
$tape="\\\\.\\Tape1";
# ... and next slot
$slot+=1;
print "nsrjb -s $server -n -l -S $slot -f $tape\n";
print "scanner -n -i $tape\n";
print "nsrjb -s $server -u -f $tape\n";
}
 
If you want to check the tapes or data integrity and you have a minimum of 2 tapes why don´t you clone your savesets ?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top