Click to See Complete Forum and Search --> : Probs w/ NTBackup command line script


opiate
January 20th, 2004, 11:16 AM
Here is the script I would like to run for daily incremental backups. When I open up the NTBackup log here is the error I get when the script runs.
"The operation was not performed because an invalid Removable storage GUID was specified."

Here is the script:

REM - Finding tape name for SEW80201 Incremental
rem ECHO OFF
:checkmedia
set media=
for /f "Tokens=*" %%a in ('rsm view /cg4187295E74AB40C2A36EA0A1DA1CCCCD /TPhysical_media /guiddisplay') do (
if not "%%a"=="The command completed successfully." set media="%%a"
)
if /i %media% EQU "Unable to open session with the RSM server." goto checkmedia
if /i %media% EQU "PHYSICAL_MEDIA" goto notape
if not defined media goto notape

rsm.exe refresh /LF"Hewlett Packard LTO Ultrium tape drive"

sleep 30
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
c:\winnt\system32\ntbackup.exe backup "@C:\ntbackupjobs\SEW80201-backup.bks" /j "%computername% %dtt%" /G "%media%" /d "%computername% %dtt%" /a /v:no /r:no /rs:no /hc:on /m incremental



This script finds the current media guid, formats the current date and lables the incremental tape. You must reference the media guid. I have found that when the variable %media% is returned it looks like ""DAEFBAFF5FBB402B9995F98257C8D2D9"" for some reason it automatically adds "". I've removed mine so the line reads /G %media% but this dosent work. I also tried the tape name and the variable will return "SEW80201 - Incrementa 01-20-200 - 1" as the tape name. But I get the same error as above except insted of saying guid it says tape name. For some reason it adds the "- 1" to the end of the tape. Does anyone know what could be the problem? How could I trim off the "- 1" from the end of the tape name.