JSI Tip 7925. How can I prepare for a scheduled backup to a stand-alone tape device that will require a 2nd tape?

Since writing tip 7914 » How can I prepare for a scheduled backup to a stand-alone tape device that will require a 2nd tape, two events have transpired to cause me to revise the tip:

1. I have scripted LastNNP.bat (Last Non-Null Parameter), which makes it easier to locate a GUID (Globally Unique IDentifier), which is the last string returned by a RSM command when using the /guiddisplay switch.

2. Microsoft has released hotfix 831740 that adds the RSM freemedia command to Windows 2000.

                       Revised Tip

When you schedule a backup to a stand-alone tape device, even if you use the /UM switch, when the first tape fills up and is ejected, the backup will quit if you insert a tape that is NOT in the Free Media pool.

This problem is due to the fact that Removable Storage cannot write a free media label on a tape when the backup is run from a batch file.

To workaround this behavior, you must Prepare the extra tapes prior to starting the backup.

Windows Server 2003 and Windows 2000 (when hotfix 831740 or SP5 is applied)

I have scripted FreeMedia.bat to deallocate the mounted tape, write a free media label to it, and eject the tape.

The syntax for using FreeMedia.bat is:

FreeMedia TapeString

Where TapeString is any unique portion of the LIBRARY name.

Example:

When I open a CMD.EXE window and type rsm view /tlibrary, it returns:

LIBRARY

Off-line Media
SAMSUNG DVD-ROM SD-616T
_NEC DVD+RW ND-1100A
Seagate STT3401A USB Device
HP Ultrium 2-SCSI SCSI Sequential Device

The command completed successfully.

Since the Library I want to use is the HP Ultrium 2-SCSI SCSI Sequential Device, running: FreeMedia ultrium would select the proper library.

NOTE: FreeMedia.bat uses LastNNP.bat.

FreeMedia.bat contains:

@echo off
IF \{%1\}==\{\} @echo Syntax: FreeMedia TapeString&Exit /b 1
setlocal
set string=%1
set string=%string:"=%
call :silent>nul 2>&1
if not defined media @echo No media in library
endlocal
exit /b 0
:silent
for /f "Tokens=2-27" %%a in ('rsm view /tlibrary /guiddisplay^|Findstr /i /c:"%string%"') do (
 call lastnnp tape %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m %%n %%o %%p %%q %%r %%s %%t %%u %%v %%w %%x %%y %%z
)
rsm INVENTORY /LG%tape% /AFULL
@ping -n 31 127.0.0.1>null
for /f "Skip=1 Tokens=2-27" %%a in ('rsm view /tphysical_media /cg%tape% /guiddisplay^|Findstr /v /c:"The command"') do (
 call lastnnp media %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m %%n %%o %%p %%q %%r %%s %%t %%u %%v %%w %%x %%y %%z
)
@ping -n 6 127.0.0.1>null
for /f "Skip=1 Tokens=2-27" %%a in ('rsm view /tpartition /cg%media% /guiddisplay^|Findstr /v /c:"The command"') do (
 call lastnnp part %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m %%n %%o %%p %%q %%r %%s %%t %%u %%v %%w %%x %%y %%z
)
rsm deallocate /pg%part%
@ping -n 6 127.0.0.1>null
rsm freemedia /pg%media%
@ping -n 6 127.0.0.1>null
rsm eject /pg%media% /ASTART

Windows 2000 (without hotfix 831740 or SP5) and Windows XP

See tip 7914 » How can I prepare for a scheduled backup to a stand-alone tape device that will require a 2nd tape?



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish