I have 1 server in particular that is running NTbackup on a nightly basis to backup the HD partitions and the system state. The backup is only about 10GB with a DDS3 "WangDAT Model 3400DX SCSI Sequential Device" drive.
I am using a script compliments of IronWill that inventories the drive and then runs a backup. A copy of the script is at the bottom.
I have this EXACT same script in MANY other instances that is working flawlessly, but I have been playing with this for a long time and I have yet to find a solution for this one. The problem is that every time it starts the script, it will give me "The operation was not performed because no storage media was specified." every single time. However, I took the time one day to completely Free every tape and try again and it was then sporatic (ie working 1 day out of the week). I have also cleaned the drive a few weeks ago just to see if it may be related to dirty heads.
I can schedule it or I can run it manually and it still usually gives the same error.
I am at a loss, I would give anything for someone to fix this PITA.
cd /d "D:\Backups\"
rem for /f %%a in ('ntdate -f %%A') do set varDayName=%%a
for /f %%a in ('ntdate -f %%Y') do set varYear=%%a
for /f %%a in ('ntdate -f %%m') do set varMonth=%%a
for /f %%a in ('ntdate -f %%d') do set varDay=%%a
rem set varWeek=%varWeek:~-2%
if not "%3"=="" set varWeek=%varWeek%%3
set varTapeName=Week %varWeek% - %varDayName%
rem If %varDayName%==Friday (set varBackupType=Normal) Else (set varBackupType=Incremental)
rem Run an inventory to refresh the currently loaded tape
rem Rename the name below to the tape drive in the server
rsm inventory /lf"WangDAT Model 3400DX SCSI Sequential Device" /AFULL
rem Below is Windows Server 2003 ntbackup command
start "" /wait ntbackup backup "@D:\Backups\Daily.bks" /n "%varDay%/%VarMonth%/%VarYear%" /d "Backup set created %varYear%/%varMonth%/%varDay%" /v:no /r:no /rs:no /hcRed Facen /m normal /j "Daily" /l:s /p "4mm DDS" /um
rem Change UserName on the following two lines to the user account that the backups run under
for /f %%a in ('dir "c:\Documents and Settings\abertram\local settings\application data\microsoft\windows nt\ntbackup\data\*.log" /od /b') do set varLog=%%a
set varLog=c:\Documents and Settings\abertram\local settings\application data\microsoft\windows nt\ntbackup\data\%varLog%
rem Find and calculate totals
for /f "tokens=*" %%a in ('type "%varLog%"^|find "Backup started"^|find /n "Backup started"^|sort /r') do set varBackupStarted=%%a
for /f "tokens=*" %%a in ('type "%varLog%"^|find "Backup completed"') do set varBackupCompleted=%%a
for /f "tokens=2" %%a in ('type "%varLog%"^|find "Directories:"') do call :countdirs %%a
for /f "tokens=2" %%a in ('type "%varLog%"^|find "Files:"') do call :countfiles %%a
for /f "tokens=2" %%a in ('type "%varLog%"^|find "Bytes:"') do (set varBytesTemp=%%a) & (call :countbytes)
rem Only usable by Windows 2000
rem set varSkipped=0
rem for /f "tokens=2" %%a in ('type "%varLog%"^|find "Skipped:"') do call :countskipped %%a
echo %varBackupStarted% 1>>BackupMail.txt
echo %varBackupCompleted% 1>>BackupMail.txt
echo Directories: %varDirs% 1>>BackupMail.txt
echo Files: %varFiles% 1>>BackupMail.txt
rem echo Skipped: %varSkipped% 1>>BackupMail.txt
echo MegaBytes: %varBytes% 1>>BackupMail.txt
rem The folder below is the location of the Pickup folder for your SMTP server
rem Use a UNC path if the folder is on another machine
Blat BackupMail.txt -subject "IDT Reliant Backed up %varBytes%MB" -to email@example.com
set /a varDirs=%varDirs%+%1
set /a varFiles=%varFiles%+%1
set /a varBytesTemp=%varBytesTemp%/1024
set /a varBytes=%varBytes%+%varBytesTemp%
set /a varSkipped=%varSkipped%+%1